chebpy/chebpy

View on GitHub
chebpy/core/decorators.py

Summary

Maintainability
B
4 hrs
Test Coverage

Function preandpostprocess has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

def preandpostprocess(f):
    """Pre- and post-processing tasks common to bary and clenshaw"""

    @wraps(f)
    def thewrapper(*args, **kwargs):
Severity: Minor
Found in chebpy/core/decorators.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 float_argument has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def float_argument(f):
    """Chebfun classmethod wrapper for __call__: ensure that we provide
    float output for float input and array output otherwise"""

    @wraps(f)
Severity: Minor
Found in chebpy/core/decorators.py - About 55 mins 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 self_empty has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def self_empty(resultif=None):
    """Factory method to produce a decorator that checks whether the object
    whose classmethod is being wrapped is empty, returning the object if
    so, but returning the supplied resultif if not. (Used in chebtech.py)"""

Severity: Minor
Found in chebpy/core/decorators.py - About 55 mins 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

Avoid too many return statements within this function.
Open

            return out[0] if np.isscalar(xx) else out
Severity: Major
Found in chebpy/core/decorators.py - About 30 mins to fix

    There are no issues that match your filters.

    Category
    Status