pygae/galgebra

View on GitHub

Showing 157 of 833 total issues

File ga.py has 1838 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""
Geometric Algebra (inherits Metric)
"""
import warnings
import operator
Severity: Major
Found in galgebra/ga.py - About 5 days to fix

    File mv.py has 1630 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """
    Multivector and Linear Multivector Differential Operator
    """
    
    import copy
    Severity: Major
    Found in galgebra/mv.py - About 4 days to fix

      File printer.py has 950 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      r"""
      ANSI Enhanced Text Printing, Text Printer and LaTeX Printer for all Geometric Algebra classes
      
      :math:`\LaTeX` printing
      -----------------------
      Severity: Major
      Found in galgebra/printer.py - About 2 days to fix

        Ga has 112 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Ga(metric.Metric):
            r"""
            The vector space (basis, metric, derivatives of basis vectors) is
            defined by the base class :class:`~galgebra.metric.Metric`.
        
        
        Severity: Major
        Found in galgebra/ga.py - About 2 days to fix

          File lt.py has 759 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          """
          Multivector Linear Transformation
          """
          
          import inspect
          Severity: Major
          Found in galgebra/lt.py - About 1 day to fix

            Mv has 80 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Mv(printer.GaPrintable):
                """
                Wrapper class for multivector objects (``self.obj``) so that it is easy
                to overload operators (``*``, ``^``, ``|``, ``<``, ``>``)  for the various
                multivector products and for printing.
            Severity: Major
            Found in galgebra/mv.py - About 1 day to fix

              File metric.py has 662 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              """
              Metric Tensor and Derivatives of Basis Vectors.
              """
              
              import copy
              Severity: Major
              Found in galgebra/metric.py - About 1 day to fix

                Function _print_Function has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _print_Function(self, expr, exp=None):
                
                        func = expr.func.__name__
                        name = func
                        if hasattr(self, '_print_' + func):
                Severity: Minor
                Found in galgebra/printer.py - About 1 day 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 Symbolic_Matrix has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
                Open

                def Symbolic_Matrix(root, coords=None, mode='g', f=False, sub=True):
                    if sub:
                        pos = '_'
                    else:
                        pos = '__'
                Severity: Minor
                Found in galgebra/lt.py - About 1 day 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 58 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _latex(self, print_obj: _LatexPrinter) -> str:
                
                        if self.obj == S.Zero:
                            return ZERO_STR
                
                
                Severity: Minor
                Found in galgebra/mv.py - About 1 day 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 57 (exceeds 5 allowed). Consider refactoring.
                Open

                    def __init__(
                        self, basis, *,
                        g=None,
                        coords=None,
                        X=None,
                Severity: Minor
                Found in galgebra/metric.py - About 1 day 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 _parse_paren has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
                Open

                def _parse_paren(line):
                    global _parse_paren_calls
                    _parse_paren_calls += 1
                
                    if ('(' not in line) or (')' not in line):
                Severity: Minor
                Found in galgebra/_utils/parser.py - About 1 day 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 47 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _latex(self, print_obj: _LatexPrinter) -> str:
                        if len(self.terms) == 0:
                            return ZERO_STR
                
                        self.consolidate_coefs()
                Severity: Minor
                Found in galgebra/mv.py - About 7 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 _sympystr has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _sympystr(self, print_obj: printer.GaPrinter) -> str:
                
                        # note: this just replaces `self` for the rest of this function
                        obj = expand(self.obj)
                        obj = metric.Simp.apply(obj)
                Severity: Minor
                Found in galgebra/mv.py - About 7 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 grad_sqr has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                Open

                    def grad_sqr(self, A, grad_sqr_mode, mode, left):
                        r"""
                        Calculate :math:`(grad *_{1} grad) *_{2} A` or :math:`A *_{2} (grad *_{1} grad)`
                        where ``grad_sqr_mode`` = :math:`*_{1}` = ``*``, ``^``, or ``|`` and
                        ``mode`` = :math:`*_{2}` = ``*``, ``^``, or ``|``.
                Severity: Minor
                Found in galgebra/ga.py - About 6 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_Pow has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _print_Pow(self, expr):
                        base = self._print(expr.base)
                        if ('_' in base or '^' in base) and 'cdot' not in base:
                            mode = True
                        else:
                Severity: Minor
                Found in galgebra/printer.py - About 5 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 35 (exceeds 5 allowed). Consider refactoring.
                Open

                    def __init__(self, *args, ga, f=False, mode='g'):
                        """
                        __init__(self, *args, ga, **kwargs)
                
                        Note this constructor is overloaded, based on the type of the
                Severity: Minor
                Found in galgebra/lt.py - About 5 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 33 (exceeds 5 allowed). Consider refactoring.
                Open

                    def __init__(self, __u, __coords, *, ga, norm=False, name=None, root='e', debug=False):
                        """
                        Parameters
                        ----------
                        u :
                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_Derivative has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _print_Derivative(self, expr):
                        dim = len(expr.variables)
                        imax = 1
                        if dim == 1:
                            if self._settings["omit_partial_derivative_fraction"]:
                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 _sympystr has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _sympystr(self, print_obj: _StrPrinter) -> str:
                        if len(self.terms) == 0:
                            return ZERO_STR
                
                        mv_terms = self.Dop_mv_expand(modes=simplify)
                Severity: Minor
                Found in galgebra/mv.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

                Severity
                Category
                Status
                Source
                Language