pbrod/numdifftools

View on GitHub

Showing 13 of 591 total issues

Bicomplex has 68 functions (exceeds 20 allowed). Consider refactoring.
Open

class Bicomplex(object):

    """
    BICOMPLEX(z1, z2)

Severity: Major
Found in src/numdifftools/multicomplex.py - About 1 day to fix

    LogRule has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class LogRule(object):
        """Log spaced finite difference rule class
    
        Parameters
        ----------
    Severity: Minor
    Found in src/numdifftools/finite_difference.py - About 2 hrs to fix

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

          def _dea(self,  epstab, n):
      
              res3la = epstab[-3:]
              nres = self._nres
      
      
      Severity: Minor
      Found in src/numdifftools/extrapolation.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 run_all_benchmarks has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      def run_all_benchmarks(method='forward', order=4, x_values=(0.1, 0.5, 1.0, 5), n_max=11,
                             show_plot=True):
      
          epsilon = MinStepGenerator(base_step=None, scale=None, step_nom=None, num_extrap=0)
      
      
      Severity: Minor
      Found in src/numdifftools/_find_default_scale.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 _check_convergence has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def _check_convergence(self, i, z0, r, m, bn):
              if self._direction_changes > 1 or self._degenerate:
                  self._num_changes += 1
                  if self._num_changes >= 1 + self.num_extrap:
                      return True, r
      Severity: Minor
      Found in src/numdifftools/fornberg.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 __init__ has 9 arguments (exceeds 7 allowed). Consider refactoring.
      Open

          def __init__(self, base_step=2.0, step_ratio=None, num_steps=15,
      Severity: Major
      Found in src/numdifftools/step_generators.py - About 45 mins to fix

        Function __call__ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def __call__(self, s_n):
        
                epstab = self.epstab
                n = len(epstab)
                epstab.append(s_n)
        Severity: Minor
        Found in src/numdifftools/extrapolation.py - About 45 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 main has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        def main():
            x = 0.5
            methods = ['complex', 'central', 'backward', 'forward']
        
            # for i, derivative in enumerate([nd.Derivative, nds.Gradient, nda.Derivative]):
        Severity: Minor
        Found in src/numdifftools/profile_numdifftools.py - About 45 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 __init__ has 9 arguments (exceeds 7 allowed). Consider refactoring.
        Open

            def __init__(self, base_step=None, step_ratio=None, num_steps=None, step_nom=None,
        Severity: Major
        Found in src/numdifftools/step_generators.py - About 45 mins to fix

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

          def approx_fprime(x, f, epsilon=None, args=(), kwargs=None, centered=True):
              """
              Gradient of function, or Jacobian if function fun returns 1d array
          
              Parameters
          Severity: Minor
          Found in src/numdifftools/nd_statsmodels.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 _compute_benchmark has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def _compute_benchmark(functions, problem_sizes):
              result_list = []
              for n in problem_sizes:
                  print('n=', n)
                  num_methods = len(functions)
          Severity: Minor
          Found in src/numdifftools/run_benchmark.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 build_main has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def build_main(version):
                  """Build and update {} version, documentation and package.
          
                  The script remove the previous built binaries and generated documentation
                  before it generate the documentation and build the binaries
          Severity: Minor
          Found in build_package.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 do_profile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def do_profile(follow=(), follow_all_methods=False):
                  """
                  Decorator to profile a function or class method
          
                  It uses line_profiler to give detailed reports on time spent on each
          Severity: Minor
          Found in src/numdifftools/profiletools.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