# pygae/galgebra

### Showing 157 of 832 total issues

#### Avoid too many return statements within this function. Open

                return self.Mul(er, blade, mode=mode)
Found in galgebra/ga.py - About 30 mins to fix

#### Avoid too many return statements within this function. Open

                    return tmp
Found in galgebra/mv.py - About 30 mins to fix

#### Avoid too many return statements within this function. Open

            return lt_v
Found in galgebra/lt.py - About 30 mins to fix

#### Avoid too many return statements within this function. Open

                return tex % (self._print(expr.base),
Found in galgebra/printer.py - About 30 mins to fix

#### Avoid too many return statements within this function. Open

                return r"{%s}^{%s}" % (self._print(expr.base), self._print(expr.exp))
Found in galgebra/printer.py - About 30 mins to fix

#### Avoid too many return statements within this function. Open

            return r"\frac{%s}{%s}" % \
Found in galgebra/printer.py - About 30 mins to fix

#### Avoid too many return statements within this function. Open

                        return tex[1:].strip()
Found in galgebra/printer.py - About 30 mins to fix

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

    def blade_expansion_dict(self) -> OrderedDict[Symbol, Expr]:
""" dictionary expanding blade basis in terms of base basis """


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

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

    def adj(self) -> 'Lt':
r"""
Returns the adjoint (a linear transformation) of the linear
transformation, :math:L, defined by :math:a\cdot{{L}\lp {b} \rp } = b\cdot{{\bar{L}}\lp {a} \rp }
where :math:a and :math:b are any two vectors in the tangent space
Found in galgebra/lt.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"

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

    def Christoffel_symbols(self, mode=1):
"""
mode = 1  Christoffel symbols of the first kind
mode = 2  Christoffel symbols of the second kind
"""
Found in galgebra/metric.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"

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

    def grades(self, A: Expr) -> List[int]:  # Return list of grades present in A
A = expand(A)
if isinstance(A, Add):
Found in galgebra/ga.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"

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

    def base_expansion_dict(self) -> OrderedDict[Symbol, Expr]:
""" dictionary expanding base basis in terms of blade basis """
base_expansion_dict = OrderedDict()

for base, blade, index in zip(self.bases.flat, self.blades.flat, self.indexes.flat):
Found in galgebra/ga.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"

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

def parse_line(line: str, op_order: List[str]) -> str:
line = line.replace(' ', '')
level_lst = _parse_paren(line)
ilevel = 0
for level in level_lst:
Found in galgebra/_utils/parser.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"

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

    def blade_reduce(lst: List[int]) -> Tuple[int, Optional[List[int]]]:
"""
Reduce wedge product of basis vectors to normal order.

lst is a list of indicies of basis vectors.  blade_reduce sorts the list
Found in galgebra/ga.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"

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

    def Mul(self, A: Expr, B: Expr, mode: str = '*') -> Expr:  # Unifies all products into one function
if mode == '*':
return self.mul(A, B)
elif mode == '^':
return self.wedge(A, B)
Found in galgebra/ga.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"

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

    def _split_name(self):
sub_str = []
root_str = []
for basis_vec in self.args:
split_lst = basis_vec.name.split('_')
Found in galgebra/atoms.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"

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

def flatten(x):
result = []

for el in x:
if isinstance(x, collections.Iterable) and not isstr(el):
Found in galgebra/utils.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"