Kev1CO/cocofest

View on GitHub

Showing 200 of 200 total issues

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

            Avoid deeply nested control flow statements.
            Open

                                    for l in remove_list:
                                        time[j].pop(l)
                                        raw_data[7].pop(l)
                            dictionary = {
            Severity: Major
            Found in data_process/force_from_c3d.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              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),
              Severity: Major
              Found in cocofest/optimization/fes_ocp_dynamics.py - About 45 mins to fix

                Function _build_phase_parameter has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def _build_phase_parameter(n_stim, final_time, frequency=None, pulse_mode="single", round_down=False):
                Severity: Minor
                Found in cocofest/optimization/fes_ocp.py - About 35 mins to fix

                  Function cn_dot_fun has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def cn_dot_fun(
                  Severity: Minor
                  Found in cocofest/models/hmed2018.py - About 35 mins to fix

                    Function get_circle_coord has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

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

                      Function configure_time_state_force_no_cross_bridge has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def configure_time_state_force_no_cross_bridge(
                      Severity: Minor
                      Found in cocofest/models/state_configue.py - About 35 mins to fix

                        Function configure_force has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def configure_force(
                        Severity: Minor
                        Found in cocofest/models/state_configue.py - About 35 mins to fix

                          Function integrate has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def integrate(
                          Severity: Minor
                          Found in cocofest/integration/ivp_fes.py - About 35 mins to fix

                            Function _set_bounds has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def _set_bounds(bio_models, fes_muscle_models, bound_type, bound_data, n_stim, initial_state):
                            Severity: Minor
                            Found in cocofest/optimization/fes_ocp_dynamics.py - About 35 mins to fix

                              Function configure_ca_troponin_complex has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def configure_ca_troponin_complex(
                              Severity: Minor
                              Found in cocofest/models/state_configue.py - About 35 mins to fix

                                Function stimulation_detection has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

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

                                  Function _sanity_check_id has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      def _sanity_check_id(
                                  Severity: Minor
                                  Found in cocofest/optimization/fes_identification_ocp.py - About 35 mins to fix

                                    Function prepare_ocp has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                    def prepare_ocp(
                                    Severity: Minor
                                    Found in cocofest/examples/dynamics/cycling/cycling_torque_driven.py - About 35 mins to fix

                                      Function configure_scaling_factor has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          def configure_scaling_factor(
                                      Severity: Minor
                                      Found in cocofest/models/state_configue.py - About 35 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language