File models.py
has 337 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""The models defined by the activemembers package."""
import datetime
import logging
- Create a ticketCreate a ticket
Function validate_unique
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def validate_unique(self, **kwargs):
try:
super().validate_unique(**kwargs)
# Skip checks if group hasn't been saved yet.
if self.group.id is not None:
- 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 clean
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def clean(self):
try:
if self.until and (not self.since or self.until < self.since):
raise ValidationError(
{"until": _("End date can't be before start date")}
- 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_absolute_url
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_absolute_url(self):
try:
return self.board.get_absolute_url()
except self.DoesNotExist:
try:
- 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"