Showing 157 of 836 total issues
File ga.py
has 1838 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Geometric Algebra (inherits Metric)
"""
import warnings
import operator
File mv.py
has 1630 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Multivector and Linear Multivector Differential Operator
"""
import copy
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
-----------------------
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`.
File lt.py
has 759 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Multivector Linear Transformation
"""
import inspect
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.
File metric.py
has 662 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Metric Tensor and Derivatives of Basis Vectors.
"""
import copy
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):
- Read upRead up
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 = '__'
- Read upRead up
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
- Read upRead up
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,
- Read upRead up
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):
- Read upRead up
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()
- Read upRead up
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)
- Read upRead up
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 ``|``.
- Read upRead up
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:
- Read upRead up
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
- Read upRead up
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 :
- Read upRead up
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"]:
- Read upRead up
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)
- Read upRead up
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"