Showing 149 of 149 total issues

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

    def __init__(
Severity: Minor
Found in bionc/bionc_numpy/natural_marker.py - About 35 mins to fix

Function compute_transformation_matrix has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def compute_transformation_matrix(
    matrix_type: TransformationMatrixType, length: float, alpha: float, beta: float, gamma: float
):
    """
    Create a transformation matrix from a TransformationMatrixType
Severity: Minor
Found in bionc/bionc_numpy/transformation_matrix.py - About 35 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 __init__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def __init__(
            self,
            name: str,
            child: NaturalSegment,
            parent_axis: tuple[CartesianAxis] | list[CartesianAxis],
Severity: Minor
Found in bionc/bionc_numpy/joints_with_ground.py - About 35 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 compute_transformation_matrix has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def compute_transformation_matrix(
    matrix_type: TransformationMatrixType, length: float, alpha: float, beta: float, gamma: float
):
    """
    Create a transformation matrix from a TransformationMatrixType
Severity: Minor
Found in bionc/bionc_casadi/transformation_matrix.py - About 35 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 check_format_experimental_heatmaps has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def check_format_experimental_heatmaps(experimental_heatmaps: dict):
    """
    Checks that the experimental heatmaps are correctly formatted

    Parameters
Severity: Minor
Found in bionc/utils/heatmap_helpers.py - About 35 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 constraints_jacobian has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def constraints_jacobian(self, Q: NaturalCoordinates) -> MX:
        """
        This function returns the joint constraints of all joints, denoted K_k
        as a function of the natural coordinates Q.

Severity: Minor
Found in bionc/bionc_casadi/biomechanical_model_joints.py - About 35 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 __new__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def __new__(cls, input_array: MX | np.ndarray | list | tuple):
        """
        Create a new instance of the class.
        """

Severity: Minor
Found in bionc/bionc_casadi/natural_vector.py - About 35 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 constraints_jacobian_derivative has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def constraints_jacobian_derivative(self, Qdot: NaturalVelocities) -> MX:
        """
        This function returns the derivative of the Jacobian matrix of the joint constraints denoted K_k_dot

        Parameters
Severity: Minor
Found in bionc/bionc_casadi/biomechanical_model_joints.py - About 35 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 __new__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def __new__(cls, input_array: MX | np.ndarray | list | tuple):
        """
        Create a new instance of the class.
        """

Severity: Minor
Found in bionc/bionc_casadi/natural_vector.py - About 35 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 constraints_jacobian has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def constraints_jacobian(self, Q: NaturalCoordinates) -> np.ndarray:
        """
        This function returns the Jacobian matrix the joint constraints, denoted K_k
        as a function of the natural coordinates Q.

Severity: Minor
Found in bionc/bionc_numpy/biomechanical_model_joints.py - About 35 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 __new__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def __new__(cls, input_array: MX | np.ndarray | list | tuple):
        """
        Create a new instance of the class.
        """

Severity: Minor
Found in bionc/bionc_casadi/cartesian_vector.py - About 35 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 __init__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def __init__(
            self,
            name: str,
            child: NaturalSegment,
            parent_axis: tuple[CartesianAxis] | list[CartesianAxis],
Severity: Minor
Found in bionc/bionc_casadi/joints_with_ground.py - About 35 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 _add_joint has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def _add_joint(self, joint: dict, segments: GenericBiomechanicalModelSegments):
        """
        This function adds a joint to the biomechanical model. It is not recommended to use this function directly.

        Parameters
Severity: Minor
Found in bionc/protocols/biomechanical_model_joints.py - About 35 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 _validate_user_provided_Q_init has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def _validate_user_provided_Q_init(
        self,
        Q_init: np.ndarray | NaturalCoordinates,
        initial_guess_mode: InitialGuessModeType,
    ) -> np.ndarray | NaturalCoordinates:
Severity: Minor
Found in bionc/bionc_numpy/inverse_kinematics.py - About 35 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 constraints_jacobian_derivative has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def constraints_jacobian_derivative(self, Qdot: NaturalVelocities) -> np.ndarray:
        """
        This function returns the derivative of the Jacobian matrix of the joint constraints denoted K_k_dot

        Parameters
Severity: Minor
Found in bionc/bionc_numpy/biomechanical_model_joints.py - About 35 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

Avoid too many return statements within this function.
Open

        return _transformation_matrix_Bwv(length, alpha, beta, gamma)
Severity: Major
Found in bionc/bionc_casadi/transformation_matrix.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return _transformation_matrix_Bvw(length, alpha, beta, gamma)
Severity: Major
Found in bionc/bionc_casadi/transformation_matrix.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return _transformation_matrix_Bwv(length, alpha, beta, gamma)
Severity: Major
Found in bionc/bionc_numpy/transformation_matrix.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return _transformation_matrix_Bvw(length, alpha, beta, gamma)
Severity: Major
Found in bionc/bionc_numpy/transformation_matrix.py - About 30 mins to fix

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

    def from_data(
        data: Data,
        relative_mass: Callable,
        center_of_mass: Callable,
        inertia: Callable,
Severity: Minor
Found in bionc/bionc_casadi/inertia_parameters.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