Showing 132 of 200 total issues
Function __init__
has a Cognitive Complexity of 189 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
c3d_path: str | list[str] = None,
calibration_matrix_path: str = None,
for_identification: bool = False,
- Read upRead up
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 _sanity_check_fes_models_inputs
has a Cognitive Complexity of 104 (exceeds 5 allowed). Consider refactoring. Open
def _sanity_check_fes_models_inputs(
biorbd_model_path,
bound_type,
bound_data,
fes_muscle_models,
- Read upRead up
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
File fes_ocp_dynamics.py
has 830 lines of code (exceeds 250 allowed). Consider refactoring. Open
import numpy as np
from bioptim import (
Axis,
BoundsList,
Function _set_bounds
has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring. Open
def _set_bounds(bio_models, fes_muscle_models, bound_type, bound_data, n_stim, initial_state):
# ---- STATE BOUNDS REPRESENTATION ---- #
#
# |‾‾‾‾‾‾‾‾‾‾x_max_middle‾‾‾‾‾‾‾‾‾‾‾‾x_max_end‾
# | max_bounds max_bounds
- Read upRead up
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
File fes_ocp.py
has 702 lines of code (exceeds 250 allowed). Consider refactoring. Open
import numpy as np
from bioptim import (
BoundsList,
ConstraintList,
Function _build_parameters
has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring. Open
def _build_parameters(
model,
n_stim,
time_min,
time_max,
- Read upRead up
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 _set_objective
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
def _set_objective(
n_stim,
n_shooting,
force_fourier_coef,
end_node_tracking,
- Read upRead up
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
File ivp_fes.py
has 401 lines of code (exceeds 250 allowed). Consider refactoring. Open
import numpy as np
from bioptim import (
ControlType,
DynamicsList,
InitialGuessList,
File ding2003_force_parameter_identification.py
has 372 lines of code (exceeds 250 allowed). Consider refactoring. Open
import time as time_package
from bioptim import Solver, Objective, OdeSolver
from ..models.fes_model import FesModel
File ding2003.py
has 372 lines of code (exceeds 250 allowed). Consider refactoring. Open
from typing import Callable
import numpy as np
from casadi import MX, exp, vertcat
Function dictionaries_check
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def dictionaries_check(self):
if not isinstance(self.fes_parameters, dict):
raise ValueError("fes_parameters must be a dictionary")
if not isinstance(self.ivp_parameters, dict):
- Read upRead up
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 32 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
pickle_path: str | list[str] = None,
muscle_name: str | list[str] = None,
forearm_angle: int | float | list[int] | list[float] = None,
- Read upRead up
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 _set_objective
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def _set_objective(
n_stim,
n_shooting,
force_fourier_coefficient,
end_node_tracking,
- Read upRead up
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
File fes_identification_ocp.py
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
import numpy as np
from bioptim import (
BoundsList,
ConstraintList,
File force_from_c3d.py
has 326 lines of code (exceeds 250 allowed). Consider refactoring. Open
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import find_peaks
from copy import deepcopy
import heapq
File hmed2018.py
has 322 lines of code (exceeds 250 allowed). Consider refactoring. Open
from typing import Callable
from casadi import MX, vertcat, tanh
import numpy as np
File fes_ocp_nmpc_cyclic.py
has 318 lines of code (exceeds 250 allowed). Consider refactoring. Open
import math
import numpy as np
from bioptim import (
SolutionMerge,
File hmed2018_force_parameter_identification.py
has 310 lines of code (exceeds 250 allowed). Consider refactoring. Open
import time as time_package
import numpy as np
from bioptim import Solver, Objective, OdeSolver
from ..models.hmed2018 import DingModelIntensityFrequency
Function average_data_extraction
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def average_data_extraction(model_data_path):
"""
Extracts average data from the provided path.
Parameters
- Read upRead up
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
File ding2007_force_parameter_identification.py
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
import time as time_package
import numpy as np
from bioptim import Solver, Objective, OdeSolver
from ..models.ding2007 import DingModelPulseDurationFrequency