pygae/galgebra

View on GitHub

Showing 155 of 899 total issues

Avoid too many return statements within this function.
Open

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

    Avoid too many return statements within this function.
    Open

                return selfxA.blade_rep()
    Severity: Major
    Found in galgebra/mv.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                          return (0, A)
      Severity: Major
      Found in galgebra/ga.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

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

          Avoid too many return statements within this function.
          Open

                              return A
          Severity: Major
          Found in galgebra/ga.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                                return A
            Severity: Major
            Found in galgebra/ga.py - About 30 mins to fix

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

              Further reading

              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
                      """
              Severity: Minor
              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"

              Further reading

              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 """
              
                      blade_expansion_dict = OrderedDict()
              
              
              Severity: Minor
              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"

              Further reading

              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
              Severity: Minor
              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"

              Further reading

              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:
              Severity: Minor
              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"

              Further reading

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

              Further reading

              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 = self.base_to_blade_rep(A)
                      A = expand(A)
                      blades = set()
                      if isinstance(A, Add):
              Severity: Minor
              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"

              Further reading

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

              Further reading

              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('_')
              Severity: Minor
              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"

              Further reading

              Severity
              Category
              Status
              Source
              Language