Showing 153 of 153 total issues

Function __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

        def __init__(
Severity: Major
Found in bionc/bionc_numpy/joints.py - About 1 hr to fix

Function _inverse_dynamics_recursive_step has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _inverse_dynamics_recursive_step(
Severity: Major
Found in bionc/bionc_casadi/biomechanical_model.py - About 1 hr to fix

Function _inverse_dynamics_recursive_step has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _inverse_dynamics_recursive_step(
Severity: Major
Found in bionc/bionc_numpy/biomechanical_model.py - About 1 hr to fix

Function create_knee_model has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def create_knee_model() -> BiomechanicalModel:
    """
    This function creates a biomechanical model of a knee with a parallel mechanism.

    Data from
Severity: Minor
Found in examples/knee_parallel_mechanism/knee_sancisi.py - About 1 hr to fix

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

    def holonomic_constraints(self, Q: NaturalCoordinates) -> MX:
        """
        This function returns the holonomic constraints of the system, denoted Phi_h
        as a function of the natural coordinates Q. They are organized as follow, for each segment:
            [Phi_k_0, Phi_r_0, Phi_k_1, Phi_r_1, ..., Phi_k_n, Phi_r_n]
Severity: Minor
Found in bionc/bionc_casadi/biomechanical_model.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 euler_axes_from_rotation_matrices has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def euler_axes_from_rotation_matrices(
    R_0_parent: MX,
    R_0_child: MX,
    sequence: EulerSequence,
    axes_source_frame: str = "mixed",
Severity: Minor
Found in bionc/bionc_casadi/rotations.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 euler_axes_from_rotation_matrices has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def euler_axes_from_rotation_matrices(
    R_0_parent: np.ndarray,
    R_0_child: np.ndarray,
    sequence: EulerSequence,
    axes_source_frame: str = "mixed",
Severity: Minor
Found in bionc/bionc_numpy/rotations.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 holonomic_constraints has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def holonomic_constraints(self, Q: NaturalCoordinates) -> np.ndarray:
        """
        This function returns the holonomic constraints of the system, denoted Phi_h
        as a function of the natural coordinates Q. They are organized as follow, for each segment:
            [Phi_k_0, Phi_r_0, Phi_k_1, Phi_r_1, ..., Phi_k_n, Phi_r_n]
Severity: Minor
Found in bionc/bionc_numpy/biomechanical_model.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 from_data has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def from_data(
Severity: Major
Found in bionc/protocols/natural_markers.py - About 1 hr to fix

Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

        def __init__(
Severity: Major
Found in bionc/bionc_numpy/joints_with_ground.py - About 1 hr to fix

Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(
Severity: Major
Found in bionc/protocols/joint.py - About 1 hr to fix

Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

        def __init__(
Severity: Major
Found in bionc/bionc_casadi/joints_with_ground.py - About 1 hr to fix

Function from_data has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def from_data(
Severity: Major
Found in bionc/bionc_numpy/natural_marker.py - About 1 hr to fix

Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

        def __init__(
Severity: Major
Found in bionc/bionc_numpy/joints_with_ground.py - About 1 hr to fix

Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(
Severity: Major
Found in bionc/protocols/joint.py - About 1 hr to fix

Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

        def __init__(
Severity: Major
Found in bionc/bionc_casadi/joints_with_ground.py - About 1 hr to fix

Function from_data has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def from_data(
Severity: Major
Found in bionc/bionc_casadi/natural_marker.py - About 1 hr to fix

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

    def __init__(
        self,
        model: BiomechanicalModel,
        experimental_markers: np.ndarray | str = None,
        experimental_heatmaps: dict[str, np.ndarray] = None,
Severity: Minor
Found in bionc/bionc_numpy/inverse_kinematics.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 main has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def main(mode: str = "x_revolute", show_structure: bool = False, show_results: bool = True):
    # Let's create a model
    model = BiomechanicalModel()
    # fill the biomechanical model with the segment
    model["pendulum"] = NaturalSegment.with_cartesian_inertial_parameters(
Severity: Minor
Found in examples/forward_dynamics/pendulum.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 main has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def main(initial_pose: str = "hanged", show_results: bool = True):
    model = build_two_link_segment()

    if initial_pose == "hanged":
        Q0 = SegmentNaturalCoordinates([1, 0, 0, 0, 0, 0, 0, 0, -0.8, 0, -1, 0])
Severity: Minor
Found in examples/play_with_joints/two_constant_length.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

Severity
Category
Status
Source
Language