chebpy/chebpy

View on GitHub
chebpy/core/chebfun.py

Summary

Maintainability
D
1 day
Test Coverage

Chebfun has 48 functions (exceeds 20 allowed). Consider refactoring.
Open

class Chebfun:
    def __init__(self, funs):
        self.funs = check_funs(funs)
        self.breakdata = compute_breakdata(self.funs)
        self.transposed = False
Severity: Minor
Found in chebpy/core/chebfun.py - About 6 hrs to fix

    File chebfun.py has 343 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import operator
    
    import numpy as np
    
    from .bndfun import Bndfun
    Severity: Minor
    Found in chebpy/core/chebfun.py - About 4 hrs to fix

      Function initfun_fixedlen has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def initfun_fixedlen(cls, f, n, domain=None):
              nn = np.array(n)
              if nn.size < 2:
                  funs = generate_funs(domain, Bndfun.initfun_fixedlen, {"f": f, "n": n})
              else:
      Severity: Minor
      Found in chebpy/core/chebfun.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 roots has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def roots(self, merge=None):
              """Compute the roots of a Chebfun, i.e., the set of values x for which
              f(x) = 0.
              """
              merge = merge if merge is not None else prefs.mergeroots
      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

      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

      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

      There are no issues that match your filters.

      Category
      Status