alice4space/qutree

View on GitHub

Showing 5 of 5 total issues

Function plot_tree has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def plot_tree(
        self,
        azim: float = -40.0,
        elev: float = 30.0,
        size_sphere: float = 2.0,
Severity: Minor
Found in qutree/__init__.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"

Further reading

Function fun_recursive has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def fun_recursive(
    psi: np.ndarray,
    coord: str = "",
    tree_vals: list = [],
    tree_idxs: list = [],
Severity: Minor
Found in qutree/__init__.py - About 55 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 bloch_points has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

def bloch_points(
Severity: Major
Found in qutree/__init__.py - About 50 mins to fix

    Function fun_recursive has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def fun_recursive(
    Severity: Minor
    Found in qutree/__init__.py - About 35 mins to fix

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

          def add_data(
              self, states: np.ndarray, colors: Optional[np.ndarray] = None, cmap: str = "jet"
          ) -> None:
              """Add data of states to the tree computing the Bloch spheres parameters.
      
      
      Severity: Minor
      Found in qutree/__init__.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