pygae/galgebra

View on GitHub

Showing 157 of 839 total issues

Function Fmt has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

def Fmt(obj, fmt=0):
    if isinstance(obj, (list, tuple, dict)):
        n = len(obj)
        if isinstance(obj, list):
            ldelim = '['
Severity: Minor
Found in galgebra/printer.py - About 4 hrs 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 pDiff has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    def pDiff(self, A: _mv.Mv, coord: Union[List, Symbol]) -> _mv.Mv:
        """
        Compute partial derivative of multivector function 'A' with
        respect to coordinate 'coord'.
        """
Severity: Minor
Found in galgebra/ga.py - About 4 hrs 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 _print_Symbol has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    def _print_Symbol(self, expr, style='plain'):

        def str_symbol(name_str):

            def translate(s):
Severity: Minor
Found in galgebra/printer.py - About 4 hrs 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 symbols_list has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

def symbols_list(s, indices=None, sub=True, commutative=False):
    """
    Convert a string to a list of symbols.

    If :class:`galgebra.printer.Eprint` is enabled, the symbol names will
Severity: Minor
Found in galgebra/metric.py - About 4 hrs 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 Mul has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    def Mul(dopl, dopr, op='*'):  # General multiplication of Dop's
        # cmpflg is True if the Dop operates on the left argument and
        # False if the Dop operates on the right argument

        if isinstance(dopl, Dop) and isinstance(dopr, Dop):
Severity: Minor
Found in galgebra/mv.py - About 3 hrs 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

Dop has 30 functions (exceeds 20 allowed). Consider refactoring.
Open

class Dop(dop._BaseDop):
    r"""
    Differential operator class for multivectors.  The operators are of
    the form

Severity: Minor
Found in galgebra/mv.py - About 3 hrs to fix

    Function characterise_Mv has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

        def characterise_Mv(self) -> None:
            if self.char_Mv:
                return
            obj = expand(self.obj)
            if isinstance(obj, numbers.Number):
    Severity: Minor
    Found in galgebra/mv.py - About 3 hrs 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 signature has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        def signature(self):
            if self.is_ortho:
                p = 0
                q = 0
                for i in self.n_range:
    Severity: Minor
    Found in galgebra/metric.py - About 3 hrs 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 a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(self, *args, ga, recp=None, coords=None, **kwargs):
            """
            __init__(self, *args, ga, recp=None, **kwargs)
    
            Note this constructor is overloaded, based on the type and number of
    Severity: Minor
    Found in galgebra/mv.py - About 3 hrs 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 Dop_mv_expand has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        def Dop_mv_expand(self, modes=None) -> List[Tuple[Expr, Expr]]:
            coefs = []
            bases = []
            self.consolidate_coefs()
    
    
    Severity: Minor
    Found in galgebra/mv.py - About 3 hrs 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

    File dop.py has 304 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """
    Differential operators, for all sympy expressions
    
    For multivector-customized differential operators, see :class:`galgebra.mv.Dop`.
    """
    Severity: Minor
    Found in galgebra/dop.py - About 3 hrs to fix

      Function tex has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

      def tex(paper=(14, 11), debug=False, prog=False, pt='10pt'):
          r"""
          Post processes LaTeX output (see comments below), adds preamble and
          postscript.
      
      
      Severity: Minor
      Found in galgebra/printer.py - About 3 hrs 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 __call__ has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
      Open

          def __call__(self, v, obj=False):
              r"""
              Returns the image of the multivector :math:`A` under the linear transformation :math:`L`.
      
              :math:`{{L}\lp {A} \rp }` is defined by the linearity of :math:`L`, the
      Severity: Minor
      Found in galgebra/lt.py - About 3 hrs 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 exp has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          def exp(self, hint: str = '-') -> 'Mv':  # Calculate exponential of multivector
              """
              Only works if square of multivector is a scalar.  If square is a
              number we can determine if square is > or < zero and hence if
              one should use trig or hyperbolic functions in expansion.  If
      Severity: Minor
      Found in galgebra/mv.py - About 2 hrs 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 compare has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

      def compare(A: Mv, B: Mv) -> Union[Expr, int]:
          """
          Determine if ``B = c*A`` where c is a scalar.  If true return c
          otherwise return 0.
          """
      Severity: Minor
      Found in galgebra/mv.py - About 2 hrs 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 metric_symbols_list has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          def metric_symbols_list(self, s=None):  # input metric tensor as string
              """
              rows of metric tensor are separated by "," and elements
              of each row separated by " ".  If the input is a single
              row it is assummed that the metric tensor is diagonal.
      Severity: Minor
      Found in galgebra/metric.py - About 2 hrs 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 reverse has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          def reverse(self, A: Expr) -> Expr:  # Calculates reverse of A (see documentation)
              A = expand(A)
              blades = {}
              if isinstance(A, Add):
                  args = A.args
      Severity: Minor
      Found in galgebra/ga.py - About 2 hrs 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 _of_basis_blades_ortho has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          def _of_basis_blades_ortho(self, blade1: Symbol, blade2: Symbol):
              # dot (|), left (<), and right (>) products
              # dot product for orthogonal basis
              index1 = self._ga.indexes_to_blades_dict.inverse[blade1]
              index2 = self._ga.indexes_to_blades_dict.inverse[blade2]
      Severity: Minor
      Found in galgebra/ga.py - About 2 hrs 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 _latex has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          def _latex(self, print_obj):
              if self.nargs <= 1:
                  return print_obj._print(self.fvalue)
              expr_lst = Mlt.expand_expr(self.fvalue, self.Ga)
              latex_str = '\\begin{aligned} '
      Severity: Minor
      Found in galgebra/lt.py - About 2 hrs 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 reduce_basis_loop has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

          def reduce_basis_loop(g, blst):
              r"""
              blst is a list of integers :math:`[i_{1},\ldots,i_{r}]` representing the geometric
              product of r basis vectors :math:`a_{{i_1}}\cdots a_{{i_r}}`. :meth:`reduce_basis_loop`
              searches along the list :math:`[i_{1},\ldots,i_{r}]` untill it finds :math:`i_{j} = i_{j+1}`
      Severity: Minor
      Found in galgebra/ga.py - About 2 hrs 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