# pygae/galgebra

### Showing 157 of 832 total issues

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

``````    def diff(self, coord) -> 'Mv':
if self.Ga.coords is None:
obj = diff(self.obj, coord)
elif coord not in self.Ga.coords:
if self.Ga.par_coords is None:``````
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 `normalize_metric` has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open

``````    def normalize_metric(self):

# normalize derivatives
if self.de is not None:
# Generate mapping for renormalizing reciprocal basis vectors``````
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 `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}```````
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 `linear_expand` has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open

``````def linear_expand(expr):
"""
linear_expand takes an expression that is the sum of a scalar
expression and a linear combination of noncommutative terms with
scalar coefficients and generates lists of coefficients and``````
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 `_latex` has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open

``````    def _latex(self, print_obj):
if len(self.terms) == 0:
return ZERO_STR

self = self._with_sorted_terms()``````
Found in galgebra/dop.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 `square_root_of_expr` has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open

``````def square_root_of_expr(expr):
"""
If expression is product of even powers then every power is divided
by two and the product is returned.  If some terms in product are
not even powers the sqrt of the absolute value of the expression is``````
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 `grade_decomposition` has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open

``````    def grade_decomposition(self, A: _MaybeMv) -> Dict[int, _MaybeMv]:
"""
Returns dictionary with grades as keys of grades of A.  For example
if A is a rotor the dictionary keys would be 0 and 2. For a vector
the single key would be 1.  Note A can be input as a multivector or``````
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 `reduce_basis` has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open

``````    def reduce_basis(self, blst):
r"""
Repetitively applies :meth:`reduce_basis_loop` to `blst`
product representation until normal form is
realized for non-orthogonal basis``````
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 `__init__` has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open

``````    def __init__(self, f, Ga, nargs=None, fct=False):
#  f is a function, a multivector, a string, or a component expression
#  self.f is a function or None such as T | a_1 where T and a_1 are vectors
#  self.fvalue is a component expression such as
#  T_x*a_1__x+T_y*a_1__y+T_z*a_1__z for a rank 1 tensor in 3 space and all``````
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"

#### `Mlt` has 21 functions (exceeds 20 allowed). Consider refactoring. Open

``````class Mlt(printer.GaPrintable):
r"""
A multilinear transformation (mlt) is a multilinear multivector function of
a list of vectors (``*args``) :math:`F(v_1,...,v_r)` where for any argument slot
:math:`j` we have (:math:`a` is a scalar and :math:`u_j` a vector)``````
Found in galgebra/lt.py - About 2 hrs to fix

#### `Sdop` has 21 functions (exceeds 20 allowed). Consider refactoring. Open

``````class Sdop(_BaseDop):
"""
Scalar differential operator is of the form (Einstein summation)

.. math:: D = c_{i}*D_{i}``````
Found in galgebra/dop.py - About 2 hrs to fix

#### Function `Add` has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open

``````    def Add(dop1, dop2):

if isinstance(dop1, Dop) and isinstance(dop2, Dop):
if dop1.Ga != dop2.Ga:
raise ValueError('In Dop.Add Dop arguments are not from same geometric algebra')``````
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 `__init__` has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open

``````    def __init__(self, bases, *, wedge=True, **kwargs):
"""
Parameters
----------
bases :``````
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 `r_basis` has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open

``````    def r_basis(self) -> List[Expr]:
r"""
Reciprocal basis vectors :math:`e^{j}` as linear combination of basis vector symbols.

These satisfy``````
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 `run` has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open

``````    def run(self):
"""Include a file as part of the content of this reST file."""

# copied from docutils.parsers.rst.directives.misc.Include
if not self.state.document.settings.file_insertion_enabled:``````
Found in doc/_sphinxext/md_include.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"

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

``````    def expand_expr(expr, ga):
lst_expr = []
expr = expand(expr)
for term in expr.args:
coef = S.One``````
Found in galgebra/lt.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"

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

``````    def even_odd(self, A: Expr, even: bool = True) -> Expr:  # Return even or odd part of A
A = expand(A)
if A.is_commutative and even:
return A
Found in galgebra/ga.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"

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

``````def xpdf(filename=None, paper=(14, 11), crop=False, png=False, prog=False, debug=False, pt='10pt', pdfprog='pdflatex'):

"""
postscript, generates tex file, inputs file to latex, displays resulting``````
Found in galgebra/printer.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"

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

``````    def of_basis_blades(self, blade1: Symbol, blade2: Symbol) -> Expr:
# geometric (*) product for orthogonal basis
if self._ga.is_ortho:
Found in galgebra/ga.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"

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

``````    def _make_grade(ga: 'Ga', __name_or_coeffs: Union[str, list, tuple], __grade: int, **kwargs) -> Expr:
""" Make a pure grade multivector. """
if not s:
return root``````
Found in galgebra/mv.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"