berrysauce / ingredients

Function with cyclomatic complexity higher than threshold PY-R1000
Anti-pattern
Minor
4 months ago4 months old
get_scan has a cyclomatic complexity of 16 with "high" risk
 56
 57
 58@app.get("/ingredients", response_class=JSONResponse)
 59def get_scan(url: str, includeCategories: Optional[bool] = False): 60    
 61    # increase compatibility
 62    if url[:4] != "http":
scan has a cyclomatic complexity of 32 with "very-high" risk
 13# FUNCTIONS
 14# ----------------------------------------
 15
 16def scan(url): 17    matching_ingredients = []
 18    
 19    def add_ingredient(category: str, ingredient: str):