Function delete
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def delete(self, user_id):
"""
DELETE the rsvp details based on specific user_id
This will probably not be used by the user
"""
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function get
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get(self, user_id):
"""
GET the rsvp details based on specific user_id
"""
# using get instead of filter and it is marginally faster than filter
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function post
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def post(self):
"""
Create new rsvp Required data:
attending
dietary_restrictions
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid too many return
statements within this function. Open
return (forbidden, 403, headers)
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return (internal_server_error, 500, headers)
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return (ret, 201, headers)
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return (forbidden, 403, headers)
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return (internal_server_error, 500, headers)
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return (not_found, 404, headers)
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return (internal_server_error, 500, headers)
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return (forbidden, 403, headers)
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return (conflict, 409, headers)
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return (not_found, 404, headers)
- Create a ticketCreate a ticket
Function get
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get(self):
"""
GET all the rsvps at a time.
"""
user_status, calling_user = has_admin_privileges()
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"