website/thaliawebsite/settings.py
File settings.py
has 983 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""Django settings for concrexit.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
- Create a ticketCreate a ticket
Function from_env
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Open
def from_env(
name, *, production=_NOT_SET, staging=_NOT_SET, testing=_NOT_SET, development=None
):
"""Generate a setting that's overridable by the process environment.
- 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 setting
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def setting(*, development, production, staging=_NOT_SET, testing=_NOT_SET):
"""Generate a setting depending on the DJANGO_ENV and the arguments.
This function is meant for static settings that depend on the DJANGO_ENV. If the
staging or testing arguments are left to their defaults, they will fall back to
- 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 from_env
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def from_env(
- Create a ticketCreate a ticket
Function setting
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def setting(*, development, production, staging=_NOT_SET, testing=_NOT_SET):
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return development
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return testing
- Create a ticketCreate a ticket