Showing 200 of 200 total issues
Avoid deeply nested control flow statements. Open
Open
for k in range(len(sliced_time)):
plt.plot(sliced_time[k], sliced_data[0][k])
for k in range(len(peaks)):
Avoid deeply nested control flow statements. Open
Open
if k == 0:
force = result["F"][0][-1]
calcium = result["Cn"][0][-1]
a = result["A"][0][-1]
km = result["Km"][0][-1]
Function get_muscle_force
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def get_muscle_force(self, local_torque_force_vector):
self.all_biceps_force_vector = []
for i in range(len(local_torque_force_vector)):
self.biceps_force_vector = []
for j in range(len(local_torque_force_vector[i][0])):
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(
Function _set_objective
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _set_objective(model, n_stim, n_shooting, force_tracking, custom_objective, **kwargs):
Avoid deeply nested control flow statements. Open
Open
for l in remove_list:
sliced_time[j].pop(l)
Avoid deeply nested control flow statements. Open
Open
for l in remove_list:
time[j].pop(l)
raw_data[7].pop(l)
dictionary = {
Avoid deeply nested control flow statements. Open
Open
if isinstance(fixed_pulse_duration, list):
parameters_bounds.add(
parameter_name,
min_bound=np.array(fixed_pulse_duration),
max_bound=np.array(fixed_pulse_duration),
Function _build_phase_parameter
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _build_phase_parameter(n_stim, final_time, frequency=None, pulse_mode="single", round_down=False):
Function cn_dot_fun
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def cn_dot_fun(
Function get_circle_coord
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def get_circle_coord(
Function configure_time_state_force_no_cross_bridge
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def configure_time_state_force_no_cross_bridge(
Function configure_force
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def configure_force(
Function integrate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def integrate(
Function _set_bounds
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _set_bounds(bio_models, fes_muscle_models, bound_type, bound_data, n_stim, initial_state):
Function configure_ca_troponin_complex
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def configure_ca_troponin_complex(
Function stimulation_detection
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def stimulation_detection(
Function _sanity_check_id
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _sanity_check_id(
Function prepare_ocp
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def prepare_ocp(
Function configure_scaling_factor
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def configure_scaling_factor(