Kev1CO/cocofest

View on GitHub

Showing 132 of 200 total issues

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

    def dynamics(
Severity: Major
Found in cocofest/models/hmed2018.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_with_fatigue.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_with_fatigue.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 system_dynamics has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

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

        Function force_model_identification has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def force_model_identification(self):
                """
                Performs the force model identification.
        
                Returns
        Severity: Minor
        Found in cocofest/identification/hmed2018_force_parameter_identification.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 _sanity_check_id has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def _sanity_check_id(
                model=None,
                n_shooting=None,
                final_time_phase=None,
                force_tracking=None,
        Severity: Minor
        Found in cocofest/optimization/fes_identification_ocp.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 store_results has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def store_results(self, sol_time, sol_states, sol_parameters, index):
                if self.cycle_to_keep == "middle":
                    # Get the middle phase index to keep
                    phase_to_keep = int(math.ceil(self.n_simultaneous_cycles / 2))
                    self.first_node_in_phase = self.n_stim * (phase_to_keep - 1)
        Severity: Minor
        Found in cocofest/optimization/fes_ocp_nmpc_cyclic.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 force_model_identification has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def force_model_identification(self) -> dict[str, np.ndarray]:
                """
                Performs the force model identification.
        
                Returns
        Severity: Minor
        Found in cocofest/identification/ding2007_force_parameter_identification.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 full_data_extraction has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

        def full_data_extraction(model_data_path):
            """
            Extracts full data from the provided path.
        
            Parameters
        Severity: Minor
        Found in cocofest/identification/identification_method.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 _set_constraints has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def _set_constraints(constraints, custom_constraint):
                if custom_constraint:
                    for i in range(len(custom_constraint)):
                        if custom_constraint[i]:
                            for j in range(len(custom_constraint[i])):
        Severity: Minor
        Found in cocofest/optimization/fes_ocp_dynamics.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 _fill_dict has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def _fill_dict(pulse_event, pulse_duration, pulse_intensity, objective):
                """
                This method fills the provided dictionaries with default values if they are not set.
        
                Parameters
        Severity: Minor
        Found in cocofest/optimization/fes_ocp.py - About 55 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 set_zero_level has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def set_zero_level(data: np.array, average_length: int = 1000, average_on: list[int, int] = None):
                """
                Set the zero level of the data by averaging the first 1000 points
                :param data: The data to set the zero level
                :param average_length: The number of points to average
        Severity: Minor
        Found in data_process/force_from_c3d.py - About 55 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 _nmpc_sanity_check has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def _nmpc_sanity_check(self):
                if not isinstance(self.n_total_cycles, int):
                    raise TypeError("n_total_cycles must be an integer")
                if not isinstance(self.n_simultaneous_cycles, int):
                    raise TypeError("n_simultaneous_cycles must be an integer")
        Severity: Minor
        Found in cocofest/optimization/fes_ocp_nmpc_cyclic.py - About 55 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 _set_parameters has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def _set_parameters(
        Severity: Major
        Found in cocofest/optimization/fes_identification_ocp.py - About 50 mins to fix

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

              def _set_objective(
          Severity: Major
          Found in cocofest/optimization/fes_ocp.py - About 50 mins to fix

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

                def input_sanity(
            Severity: Major
            Found in cocofest/identification/ding2003_force_parameter_identification.py - About 50 mins to fix

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

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

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

                    def _set_objective(
                Severity: Major
                Found in cocofest/optimization/fes_ocp_nmpc_cyclic.py - About 50 mins to fix

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

                      def input_sanity(
                  Severity: Major
                  Found in cocofest/identification/identification_abstract_class.py - About 50 mins to fix

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

                        def system_dynamics(
                    Severity: Major
                    Found in cocofest/models/hmed2018.py - About 50 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language