chebpy/chebpy

View on GitHub

Showing 26 of 32 total issues

Function _apply_binop has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def _apply_binop(self, f, op):
        """Funnel method used in the implementation of Chebfun binary
        operators. The high-level idea is to first break each chebfun into a
        series of pieces corresponding to the union of the domains of each
        before applying the supplied binary operator and simplifying. In the
Severity: Minor
Found in chebpy/core/chebfun.py - About 35 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 min((cutoff, n - 1))
Severity: Major
Found in chebpy/core/algorithms.py - About 30 mins to fix

    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

      Avoid too many return statements within this function.
      Open

              return Chebfun.initconst(float(f), domain)
      Severity: Major
      Found in chebpy/api.py - About 30 mins to fix

        Function adaptive has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        def adaptive(cls, fun, hscale=1, maxpow2=None):
            """Adaptive constructor: cycle over powers of two, calling
            standard_chop each time, the output of which determines whether or not
            we are happy."""
            minpow2 = 4  # 17 points
        Severity: Minor
        Found in chebpy/core/algorithms.py - About 25 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 _break has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def _break(self, targetdomain):
                """Resamples self to the supplied Domain object, targetdomain. This
                method is intended as private since one will typically need to have
                called either Domain.union(f), or Domain.merge(f) prior to call."""
                newfuns = []
        Severity: Minor
        Found in chebpy/core/chebfun.py - About 25 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

        Severity
        Category
        Status
        Source
        Language