termoshtt/continuate

View on GitHub

Showing 15 of 19 total issues

File newton.py has 275 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
""" Basic Newton methods using Krylov subspace method. """

import numpy as np
from numpy.linalg import norm
Severity: Minor
Found in continuate/newton.py - About 2 hrs to fix

    Function hook_step has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def hook_step(A, b, trusted_region, hook_maxiter, hook_tol, nu=0, **opt):
    Severity: Major
    Found in continuate/newton.py - About 50 mins to fix

      Function tangent_vector has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def tangent_vector(func, x, mu, tangent_dmu=1e-7, dxi=None, **opt):
      Severity: Minor
      Found in continuate/arclength.py - About 45 mins to fix

        Function gmres has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def gmres(A, b, x0=None, krylov_tol=default_options["krylov_tol"],
        Severity: Minor
        Found in continuate/krylov.py - About 45 mins to fix

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

          def gmres_factorize(A, r, krylov_tol=default_options["krylov_tol"],
          Severity: Minor
          Found in continuate/krylov.py - About 35 mins to fix

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

            def newton_krylov(func, x0, newton_tol, newton_maxiter, **opt):
            Severity: Minor
            Found in continuate/newton.py - About 35 mins to fix

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

              def continuation(func, x, mu, delta, **opt):
              Severity: Minor
              Found in continuate/simple.py - About 35 mins to fix

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

                def newton_krylov_hook_gen(func, x0, trusted_region,
                Severity: Minor
                Found in continuate/newton.py - About 35 mins to fix

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

                  def continuation(func, x, mu, delta, **opt):
                  Severity: Minor
                  Found in continuate/arclength.py - About 35 mins to fix

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

                    def Jacobi(func, x0, jacobi_alpha, fx=None, **opt):
                    Severity: Minor
                    Found in continuate/newton.py - About 35 mins to fix

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

                      def arnoldi_common(A, r, krylov_tol=default_options["krylov_tol"], **cfg):
                          """ Support generator for Arnoldi process
                      
                          Parameters
                          -----------
                      Severity: Minor
                      Found in continuate/krylov.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 gmres_factorize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def gmres_factorize(A, r, krylov_tol=default_options["krylov_tol"],
                                          krylov_maxiter=default_options["krylov_maxiter"], **cfg):
                          """
                          Execute a factorization :math:`AV = VQR`
                          to solve minimization problem :math:`|Ax-b| = |VQ(Ry-g)| = |Ry-g|`.
                      Severity: Minor
                      Found in continuate/krylov.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 mgs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def mgs(vectors, eps=1e-9):
                          """ modified Gram-Schmit algorithm
                      
                          Parameters
                          -----------
                      Severity: Minor
                      Found in continuate/qr.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 trusted_region has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def trusted_region(self, v, eps, r0=None, p=2):
                              """ Estimate the trusted region in which the deviation is smaller than `eps`.
                      
                              Parameters
                              ------------
                      Severity: Minor
                      Found in continuate/newton.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 hook_step has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def hook_step(A, b, trusted_region, hook_maxiter, hook_tol, nu=0, **opt):
                          """ optimal hook step based on trusted region approach
                      
                          Return :math:`x` which minimizes :math:`|Ax-b|`
                          under the constraint :math:`|x| < r`,
                      Severity: Minor
                      Found in continuate/newton.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