Kev1CO/cocofest

View on GitHub

Showing 132 of 200 total issues

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

    def prepare_ocp(
Severity: Major
Found in cocofest/optimization/fes_identification_ocp.py - About 1 hr to fix

    Function __init__ has 12 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(
    Severity: Major
    Found in cocofest/identification/hmed2018_force_parameter_identification.py - About 1 hr to fix

      Function __init__ has 12 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(
      Severity: Major
      Found in cocofest/identification/ding2003_force_parameter_identification.py - About 1 hr to fix

        Function __init__ has 12 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(
        Severity: Major
        Found in cocofest/identification/ding2007_force_parameter_identification.py - About 1 hr to fix

          Function plot has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              def plot(self, starting_location: str = None, show_rehastim=False):
                  """
                  Plot the muscle stimulation angle of a cycling motion
                  Parameters
                  ----------
          Severity: Minor
          Found in cocofest/result/plot.py - About 1 hr 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 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def __init__(
                  self,
                  fes_parameters: dict = None,
                  ivp_parameters: dict = None,
              ):
          Severity: Minor
          Found in cocofest/integration/ivp_fes.py - About 1 hr to fix

            Function muscles_joint_torque has 11 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def muscles_joint_torque(
            Severity: Major
            Found in cocofest/models/dynamical_model.py - About 1 hr to fix

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

                  def _set_objective(
              Severity: Major
              Found in cocofest/optimization/fes_ocp_dynamics.py - About 1 hr to fix

                Function prepare_nmpc has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def prepare_nmpc(self):
                        (pulse_event, pulse_duration, pulse_intensity, objective) = OcpFes._fill_dict(
                            self.pulse_event, self.pulse_duration, self.pulse_intensity, self.objective
                        )
                
                
                Severity: Minor
                Found in cocofest/optimization/fes_ocp_nmpc_cyclic.py - About 1 hr to fix

                  Function prepare_ocp has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def prepare_ocp(
                          model: FesModel = None,
                          n_stim: int = None,
                          n_shooting: int = None,
                          final_time: int | float = None,
                  Severity: Minor
                  Found in cocofest/optimization/fes_ocp.py - About 1 hr to fix

                    Function dynamics has 10 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def dynamics(
                    Severity: Major
                    Found in cocofest/models/ding2007_with_fatigue.py - About 1 hr to fix

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

                          def system_dynamics(
                      Severity: Major
                      Found in cocofest/models/hmed2018_with_fatigue.py - About 1 hr to fix

                        Function dynamics has 10 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def dynamics(
                        Severity: Major
                        Found in cocofest/models/ding2003.py - About 1 hr to fix

                          Function dynamics has 10 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def dynamics(
                          Severity: Major
                          Found in cocofest/models/ding2007.py - About 1 hr to fix

                            Function muscle_dynamic has 10 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def muscle_dynamic(
                            Severity: Major
                            Found in cocofest/models/dynamical_model.py - About 1 hr to fix

                              Function dynamics has 10 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def dynamics(
                              Severity: Major
                              Found in cocofest/models/fes_model.py - About 1 hr to fix

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

                                    def prepare_ocp(
                                Severity: Major
                                Found in cocofest/optimization/fes_ocp.py - About 1 hr to fix

                                  Function dynamics has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      def dynamics(
                                          time: MX,
                                          states: MX,
                                          controls: MX,
                                          parameters: MX,
                                  Severity: Minor
                                  Found in cocofest/models/hmed2018.py - About 1 hr 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 dynamics has 10 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      def dynamics(
                                  Severity: Major
                                  Found in cocofest/models/hmed2018_with_fatigue.py - About 1 hr to fix

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

                                        def system_dynamics(
                                    Severity: Major
                                    Found in cocofest/models/ding2007_with_fatigue.py - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language