Showing 28 of 28 total issues
Function dispatch
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def dispatch(self, request, token=None, uidb64=None, *args, **kwargs):
Function on_retry
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def on_retry(self, exc, task_id, args, kwargs, einfo):
Function send_user_review_nofication
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_user_review_nofication(
Function on_failure
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def on_failure(self, exc, task_id, args, kwargs, einfo):
Function twitter_validation_function
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def twitter_validation_function(value):
path = None
try:
url_parts = _get_url_parts(value)
# check if acceptable domain
- 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 dispatch
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def dispatch(self, request, *args, **kwargs):
logger.debug(f"{self.__class__.__name__} access check")
if (
self.access_granted or self.access_form_valid
- 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 authenticate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def authenticate(self, request, username, password):
username = sha256(username.encode("utf-8")).hexdigest()
username_index = index(username)
for user in Account.objects.filter(username_index=username_index):
if not user or not bcrypt.checkpw(
- 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 _passphrase_next_url
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _passphrase_next_url(self, request):
next_url = None
if "next" in request.GET:
if re.search(r"^/[\W/-]*", request.GET["next"]):
if is_safe_url(request.GET["next"]):
- 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"