um-cseg/chez-betty

View on GitHub
chezbetty/models/model.py

Summary

Maintainability
B
4 hrs
Test Coverage

Function limitable_all has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def limitable_all(fn_wrapped_by_limitable_all):
    @functools.wraps(fn_wrapped_by_limitable_all)
    def limitable_all_wrapper(*args, limit=None, offset=None, count=False, **kwargs):
        q = fn_wrapped_by_limitable_all(*args, **kwargs)
        if offset:
Severity: Minor
Found in chezbetty/models/model.py - About 1 hr to fix

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 limitable_request has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def limitable_request(request, fn, prefix=None, limit=None, count=False):
    if prefix:
        limit_str = prefix + '_limit'
        offset_str = prefix + '_offset'
    else:
Severity: Minor
Found in chezbetty/models/model.py - About 1 hr to fix

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 limitable_request has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def limitable_request(request, fn, prefix=None, limit=None, count=False):
Severity: Minor
Found in chezbetty/models/model.py - About 35 mins to fix

    Function limitable_all_wrapper has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def limitable_all_wrapper(*args, limit=None, offset=None, count=False, **kwargs):
    Severity: Minor
    Found in chezbetty/models/model.py - About 35 mins to fix

      There are no issues that match your filters.

      Category
      Status