Kev1CO/cocofest

View on GitHub

Showing 132 of 200 total issues

Function f_dot_fun has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def f_dot_fun(
Severity: Major
Found in cocofest/models/ding2003.py - About 50 mins to fix

    Function f_dot_fun has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def f_dot_fun(
    Severity: Major
    Found in cocofest/models/fes_model.py - About 50 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              for k in range(1, len(time[j])):
                                  if counter == 9:
                                      counter = 0
                                  else:
                                      remove_list.append(k)
      Severity: Major
      Found in data_process/force_from_c3d.py - About 45 mins to fix

        Function system_dynamics has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def system_dynamics(
        Severity: Minor
        Found in cocofest/models/ding2003.py - About 45 mins to fix

          Function system_dynamics has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def system_dynamics(
          Severity: Minor
          Found in cocofest/models/fes_model.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    for k in range(1, len(sliced_time[j])):
                                        if counter == 9:
                                            counter = 0
                                        else:
                                            remove_list.append(k)
            Severity: Major
            Found in data_process/force_from_c3d.py - About 45 mins to fix

              Function inverse_kinematics_cycling has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def inverse_kinematics_cycling(
              Severity: Minor
              Found in cocofest/dynamics/inverse_kinematics_and_dynamics.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if isinstance(fixed_pulse_intensity, list):
                                            parameters_bounds.add(
                                                parameter_name,
                                                min_bound=np.array(fixed_pulse_intensity),
                                                max_bound=np.array(fixed_pulse_intensity),
                Severity: Major
                Found in cocofest/optimization/fes_ocp_dynamics.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          for k in range(len(sliced_data)):
                                              remove_list = []
                                              counter = 0
                                              for m in range(1, len(sliced_data[k][j])):
                                                  if counter == 9:
                  Severity: Major
                  Found in data_process/force_from_c3d.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if saving_pickle_path_list[:-4] == ".pkl":
                                                save_pickle_path = saving_pickle_path_list[:-4] + "_" + str(i) + ".pkl"
                                            else:
                                                save_pickle_path = saving_pickle_path_list[0] + "_" + str(i) + ".pkl"
                                        else:
                    Severity: Major
                    Found in data_process/force_from_c3d.py - About 45 mins to fix

                      Function muscles_joint_torque has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def muscles_joint_torque(
                              time: MX | SX,
                              states: MX | SX,
                              controls: MX | SX,
                              parameters: MX | SX,
                      Severity: Minor
                      Found in cocofest/models/dynamical_model.py - About 45 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 deeply nested control flow statements.
                      Open

                                              for k in range(len(peaks)):
                                                  plt.plot(time[peaks[k]], filtered_6d_force[0][peaks[k]], "x")
                                              if down_sample:
                      Severity: Major
                      Found in data_process/force_from_c3d.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if down_sample:
                                                    for k in range(len(sliced_time)):
                                                        plt.plot(temp_time[k], temp_data[0][k])
                                                plt.show()
                        Severity: Major
                        Found in data_process/force_from_c3d.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  for k in range(len(filtered_6d_force)):
                                                      remove_list = []
                                                      counter = 0
                                                      for m in range(1, len(filtered_6d_force[k][j])):
                                                          if counter == 9:
                          Severity: Major
                          Found in data_process/force_from_c3d.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    for k in range(len(sliced_time)):
                                                        plt.plot(sliced_time[k], sliced_data[0][k])
                                                    for k in range(len(peaks)):
                            Severity: Major
                            Found in data_process/force_from_c3d.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                              if k == 0:
                                                  force = result["F"][0][-1]
                                                  calcium = result["Cn"][0][-1]
                                                  a = result["A"][0][-1]
                                                  km = result["Km"][0][-1]
                              Severity: Major
                              Found in cocofest/examples/sensitivity/truncation/sensitivity_analysis.py - About 45 mins to fix

                                Function get_muscle_force has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                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])):
                                Severity: Minor
                                Found in data_process/force_from_sensor.py - About 45 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 6 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def __init__(
                                Severity: Minor
                                Found in data_process/force_from_c3d.py - About 45 mins to fix

                                  Function _set_objective has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      def _set_objective(model, n_stim, n_shooting, force_tracking, custom_objective, **kwargs):
                                  Severity: Minor
                                  Found in cocofest/optimization/fes_identification_ocp.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                            for l in remove_list:
                                                                sliced_time[j].pop(l)
                                    
                                    
                                    Severity: Major
                                    Found in data_process/force_from_c3d.py - About 45 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language