Showing 12 of 12 total issues
Function _need_maintenance_ignore_ip_addresses
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _need_maintenance_ignore_ip_addresses(request):
if not settings.MAINTENANCE_MODE_IGNORE_IP_ADDRESSES:
return
if settings.MAINTENANCE_MODE_GET_CLIENT_IP_ADDRESS:
- Read upRead up
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 need_maintenance_response
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def need_maintenance_response(request):
"""
Tells if the given request needs a maintenance response or not.
"""
- Read upRead up
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 _need_maintenance_ignore_users
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _need_maintenance_ignore_users(request):
if not hasattr(request, "user"):
return
user = request.user
- Read upRead up
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 value
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return value
Avoid too many return
statements within this function. Open
return value
Avoid too many return
statements within this function. Open
return value
Avoid too many return
statements within this function. Open
return value
Avoid too many return
statements within this function. Open
return True
Function _need_maintenance_ignore_urls
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _need_maintenance_ignore_urls(request):
if not settings.MAINTENANCE_MODE_IGNORE_URLS:
return
for url in settings.MAINTENANCE_MODE_IGNORE_URLS:
- Read upRead up
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 _need_maintenance_ignore_tests
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _need_maintenance_ignore_tests(request):
if not settings.MAINTENANCE_MODE_IGNORE_TESTS:
return
is_testing = False
- Read upRead up
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"