Showing 149 of 149 total issues
InverseKinematics
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class InverseKinematics:
"""
Inverse kinematics solver also known as Multibody Kinematics Optimization (MKO)
Attributes
- Create a ticketCreate a ticket
File natural_inertial_parameters.py
has 301 lines of code (exceeds 250 allowed). Consider refactoring. Open
from typing import Union
import numpy as np
from numpy import eye, zeros
from numpy.linalg import inv
- Create a ticketCreate a ticket
File right_side_lower_limb.py
has 299 lines of code (exceeds 250 allowed). Consider refactoring. Open
import os
from pathlib import Path
import ezc3d
import numpy as np
- Create a ticketCreate a ticket
File generalized_force.py
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
import numpy as np
from .external_force import ExternalForce
from .natural_coordinates import SegmentNaturalCoordinates, NaturalCoordinates
from .rotations import euler_axes_from_rotation_matrices
- Create a ticketCreate a ticket
File natural_inertial_parameters.py
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
from typing import Union
import numpy as np
from casadi import MX
from casadi import transpose, dot, inv
- Create a ticketCreate a ticket
Function __init__
has 20 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
- Create a ticketCreate a ticket
Function holonomic_constraints_jacobian_derivative
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def holonomic_constraints_jacobian_derivative(self, Qdot: NaturalVelocities) -> MX:
"""
This function returns the Jacobian matrix the holonomic constraints, denoted Kdot.
They are organized as follow, for each segment, the rows of the matrix are:
[Phi_k_0, Phi_r_0, Phi_k_1, Phi_r_1, ..., Phi_k_n, Phi_r_n]
- Read upRead up
- Create a ticketCreate a ticket
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_jacobian
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def holonomic_constraints_jacobian(self, Q: NaturalCoordinates) -> MX:
"""
This function returns the Jacobian matrix the holonomic constraints, denoted K.
They are organized as follow, for each segmen, the rows of the matrix are:
[Phi_k_0, Phi_r_0, Phi_k_1, Phi_r_1, ..., Phi_k_n, Phi_r_n]
- Read upRead up
- Create a ticketCreate a ticket
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_jacobian_derivative
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def holonomic_constraints_jacobian_derivative(self, Qdot: NaturalVelocities) -> np.ndarray:
"""
This function returns the Jacobian matrix the holonomic constraints, denoted Kdot.
They are organized as follow, for each segment, the rows of the matrix are:
[Phi_k_0, Phi_r_0, Phi_k_1, Phi_r_1, ..., Phi_k_n, Phi_r_n]
- Read upRead up
- Create a ticketCreate a ticket
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_jacobian
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def holonomic_constraints_jacobian(self, Q: NaturalCoordinates) -> np.ndarray:
"""
This function returns the Jacobian matrix the holonomic constraints, denoted K.
They are organized as follow, for each segmen, the rows of the matrix are:
[Phi_k_0, Phi_r_0, Phi_k_1, Phi_r_1, ..., Phi_k_n, Phi_r_n]
- Read upRead up
- Create a ticketCreate a ticket
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
GenericBiomechanicalModelSegments
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class GenericBiomechanicalModelSegments(ABC):
"""
This is an abstract base class that provides the basic structure and methods for all biomechanical models.
It contains the segments and the joints of the model. The implemented methods are not specific to numpy or casadi.
- Create a ticketCreate a ticket
File biomechanical_model_segments.py
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
import numpy as np
from abc import ABC, abstractmethod
from casadi import MX
from typing import Any
- Create a ticketCreate a ticket
Function __init__
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
model: BiomechanicalModel,
show_ground_frame: bool = True,
show_frames: bool = True,
- Read upRead up
- Create a ticketCreate a ticket
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 model_creation_from_measured_data
has 49 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
"""
- Create a ticketCreate a ticket
Function add_joint
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_joint(
- Create a ticketCreate a ticket
Function __init__
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
- Create a ticketCreate a ticket
Function generate_c3d_file
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate_c3d_file():
"""
This function generates a c3d file with full body open pose markerset
This is made to not overload the repository with a c3d file
- Create a ticketCreate a ticket
Function from_components
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def from_components(cls, x: MX, y: MX, z: MX, t: MX):
"""
Constructor of the class from the components of the homogenous transform
Parameters
- Read upRead up
- Create a ticketCreate a ticket
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, MX, list] = None,
rpdot: Union[np.ndarray, MX, list] = None,
rddot: Union[np.ndarray, MX, list] = None,
- Read upRead up
- Create a ticketCreate a ticket
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,
uddot: Union[np.ndarray, list] = None,
rpddot: Union[np.ndarray, list] = None,
rdddot: Union[np.ndarray, list] = None,
- Read upRead up
- Create a ticketCreate a ticket
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"