# pygae/galgebra

### Showing 157 of 832 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 = '['
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"

#### 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'.
"""
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"

#### 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):
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"

#### 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
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"

#### 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):
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"

#### 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


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):
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"

#### 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
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"

#### 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()


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"

#### 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:
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"

#### 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.
"""
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"""
postscript.


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"

#### 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
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"

#### 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.
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"

#### 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.
"""
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"

#### 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)
args = A.args
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"

#### 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
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"

#### 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} '
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"

#### 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
index2 = self._ga.indexes_to_blades_dict.inverse[blade2]
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"

#### Function oprint has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open

def oprint(*args, dict_mode=False):
"""
Debug printing for iterated (list/tuple/dict/set) objects. args is
of form (title1, object1, title2, object2, ...) and prints::


Found in galgebra/printer.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"