pluwum/shopping-list

View on GitHub
app/classes.py

Summary

Maintainability
A
2 hrs
Test Coverage

Showing 3 of 3 total issues

Function create_shopping_list has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def create_shopping_list(self, name, description, user_email):
"""This method creates a shopping list for a user"""
# Check if required input parameter is missing
if name is None or description is None or user_email is None:
raise Exception("Missing Field:Please provide name & Description")
Severity: Minor
Found in app/classes.py - About 1 hr to fix

Function user_update_item_in_list has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def user_update_item_in_list(self, shopping_list, list_item, item_name,
Severity: Minor
Found in app/classes.py - About 35 mins to fix

    Function edit_shopping_list has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    def edit_shopping_list(self, id, user_email, name=None, description=None):
    """This method edits the shopping list at index id and email"""
    # Make sure the list we are editing exists
    if user_email not in self.shopping_lists:
    raise Exception("Oops! List does not exist in User's records")
    Severity: Minor
    Found in app/classes.py - About 25 mins to fix
    Category
    Status