Showing 149 of 149 total issues

Function from_components has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def from_components(
        cls,
        uddot: Union[np.ndarray, MX, list] = None,
        rpddot: Union[np.ndarray, MX, list] = None,
        rdddot: Union[np.ndarray, MX, list] = None,
Severity: Minor
Found in bionc/bionc_casadi/natural_accelerations.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_components has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def from_components(
        cls,
        udot: Union[np.ndarray, list] = None,
        rpdot: Union[np.ndarray, list] = None,
        rddot: Union[np.ndarray, list] = None,
Severity: Minor
Found in bionc/bionc_numpy/natural_velocities.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 __init__ has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

Function with_cartesian_inertial_parameters has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

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

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

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

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

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

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

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

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

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

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

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

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

Function with_cartesian_inertial_parameters has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

Function add_all_joint_generalized_forces has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def add_all_joint_generalized_forces(
        self, model: "BiomechanicalModel", joint_generalized_forces: np.ndarray, Q: NaturalCoordinates
    ):
        """
        Add all the generalized forces to the object. It separates the generalized forces into sub generalized forces
Severity: Minor
Found in bionc/bionc_numpy/generalized_force.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 __init__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

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

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

Function main has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def main(mode: str = "horizontal"):
    nb_segments = 3

    model = build_n_link_pendulum(nb_segments=nb_segments)

Severity: Minor
Found in examples/inverse_dynamics/three_link_pendulum.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 __init__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

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

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

Function create_knee_model has 31 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_feikes.py - About 1 hr to fix

Function model_creation_from_measured_data has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def model_creation_from_measured_data(c3d_filename: str = "statref.c3d") -> BiomechanicalModel:
    """
    Create a model from a data file and we build the biomechanical model as a template using the marker names
    """

Severity: Minor
Found in examples/model_creation/right_side_lower_limb.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
Severity
Category
Status
Source
Language