Showing 86 of 230 total issues
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return _("The reservation cannot start and end at the same time")
Avoid too many return
statements within this function. Open
return user_details
Avoid too many return
statements within this function. Open
return ""
Avoid too many return
statements within this function. Open
return HttpResponseRedirect(reverse('admin_suggest_skill'))
Avoid too many return
statements within this function. Open
return self.quota_can_create_reservation()
Avoid too many return
statements within this function. Open
return all(rule.valid_time_in_rule(start_time, end_time, len(rules) > 1) for rule in rules)
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return _("The start time can't be after the end time")
Avoid too many return
statements within this function. Open
return _("The reservation can't start in the past")
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return not fail_if_not_standalone
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return _("The time slot is not available")
Function mock_module_attrs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def mock_module_attrs(module_and_attrname_to_newattr: dict[tuple[Any, str], Any]):
"""
A decorator for monkey patching attributes of modules while the decorated function is executed;
the original module attributes are monkey patched back after execution.
- 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 block_join
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def block_join(object_collection: Sequence | QuerySet, sep="<b>•</b>", multiline=True):
if len(object_collection) == 0:
return ""
tag = '<div style="display: inline-block; white-space: nowrap;">'
- 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 _do_request_assertion_for_path
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _do_request_assertion_for_path(self, path: str, language_prefix: str, client: Client, is_superuser: bool, test_case: SimpleTestCase):
response = client.get(path)
if self.redirect:
test_case.assertIn(response.status_code, {HTTPStatus.MOVED_PERMANENTLY, HTTPStatus.FOUND},
- 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 inner_run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def inner_run(self, *args, **options):
if not settings.DEBUG:
super().inner_run(*args, **options)
addr_regex = r"(?:127\.0\.0\.1|localhost)"
- 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"