Showing 132 of 200 total issues
Function get_initial_guess
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_initial_guess(biorbd_model_path: str, final_time: int, n_stim: int, n_shooting: int, objective: dict) -> dict:
Function remove_duplicates
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def remove_duplicates(self, time):
states = self.sol.decision_states(to_merge=[SolutionMerge.PHASES, SolutionMerge.NODES])
vals, idx_start, count = np.unique(time, return_counts=True, return_index=True)
time = time[idx_start]
state_keys = states.keys()
- 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 dynamics
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def dynamics(
time: MX,
states: MX,
controls: MX,
parameters: MX,
- 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 get_intensity_parameters
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_intensity_parameters(nlp, parameters: ParameterList, muscle_name: str = None) -> MX:
"""
Get the nlp list of intensity parameters
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
Function dynamics
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def dynamics(
time: MX,
states: MX,
controls: MX,
parameters: MX,
- 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 get_pulse_duration_parameters
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_pulse_duration_parameters(nlp, parameters: ParameterList, muscle_name: str = None) -> MX:
"""
Get the nlp list of pulse_duration parameters
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
Function cn_sum_fun
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def cn_sum_fun(self, r0: MX | float, t: MX, t_stim_prev: list[MX]) -> MX | float:
"""
Parameters
----------
r0: MX | float
- 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 cn_sum_fun
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def cn_sum_fun(
self, r0: MX | float, t: MX, t_stim_prev: list[MX] = None, intensity_stim: list[MX] = None
) -> MX | float:
"""
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
Function configure_all_muscle_states
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def configure_all_muscle_states(self, muscles_dynamics_model, ocp, nlp):
state_name_list = []
for muscle_dynamics_model in muscles_dynamics_model:
for state_key in muscle_dynamics_model.name_dof:
if state_key in self.state_dictionary.keys():
- 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 node_shooting_list_creation
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def node_shooting_list_creation(stim, stimulated_n_shooting):
"""
Creates a list of node shooting points.
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
Function build_initial_guess_from_ocp
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def build_initial_guess_from_ocp(self, ocp):
"""
Build a state, control, parameters and stochastic initial guesses for each phases from a given ocp
"""
x = InitialGuessList()
- 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 from_frequency_and_final_time
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def from_frequency_and_final_time(
cls,
fes_parameters: dict = None,
ivp_parameters: dict = 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"