Kev1CO/cocofest

View on GitHub

Showing 200 of 200 total issues

Similar blocks of code found in 5 locations. Consider refactoring.
Open

            model_time_data = [(time + global_model_time_data[i - 1][-1]) for time in model_time_data]
Severity: Major
Found in cocofest/identification/identification_method.py and 4 other locations - About 55 mins to fix
cocofest/identification/identification_method.py on lines 54..55
cocofest/identification/identification_method.py on lines 59..60
cocofest/identification/identification_method.py on lines 147..147
cocofest/identification/identification_method.py on lines 148..148

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 37.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

            average_stim_apparition = [(time + global_model_time_data[i - 1][-1]) for time in average_stim_apparition]
Severity: Major
Found in cocofest/identification/identification_method.py and 4 other locations - About 55 mins to fix
cocofest/identification/identification_method.py on lines 54..55
cocofest/identification/identification_method.py on lines 58..58
cocofest/identification/identification_method.py on lines 59..60
cocofest/identification/identification_method.py on lines 147..147

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 37.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

            stim_interval = data["stim_time"][j] - data["stim_time"][j - 1]
Severity: Minor
Found in cocofest/identification/identification_method.py and 1 other location - About 55 mins to fix
cocofest/identification/identification_method.py on lines 109..109

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 37.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

            model_time_data = [(time + global_model_time_data[i - 1][-1]) for time in model_time_data]
Severity: Major
Found in cocofest/identification/identification_method.py and 4 other locations - About 55 mins to fix
cocofest/identification/identification_method.py on lines 54..55
cocofest/identification/identification_method.py on lines 58..58
cocofest/identification/identification_method.py on lines 59..60
cocofest/identification/identification_method.py on lines 148..148

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 37.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                temp_stimulation_instant.append(data["stim_time"][j] - data["stim_time"][j - 1])
Severity: Minor
Found in cocofest/identification/identification_method.py and 1 other location - About 55 mins to fix
cocofest/identification/identification_method.py on lines 107..107

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 37.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

            model_stim_apparition_time = [
                (time + global_model_time_data[i - 1][-1]) for time in model_stim_apparition_time
Severity: Major
Found in cocofest/identification/identification_method.py and 4 other locations - About 55 mins to fix
cocofest/identification/identification_method.py on lines 54..55
cocofest/identification/identification_method.py on lines 58..58
cocofest/identification/identification_method.py on lines 147..147
cocofest/identification/identification_method.py on lines 148..148

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 37.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        ax2.plot(np.linspace(0, 1, n_frames - 1), tau[0], color="orange", label="shoulder")
cocofest/examples/dynamics/cycling/inverse_kinematics_cycling.py on lines 48..48

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 37.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

            model_stim_apparition_time = [
                stim_time + global_model_time_data[i - 1][-1] for stim_time in model_stim_apparition_time
Severity: Major
Found in cocofest/identification/identification_method.py and 4 other locations - About 55 mins to fix
cocofest/identification/identification_method.py on lines 58..58
cocofest/identification/identification_method.py on lines 59..60
cocofest/identification/identification_method.py on lines 147..147
cocofest/identification/identification_method.py on lines 148..148

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 37.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        ax2.plot(np.linspace(0, 1, n_frames - 1), tau[1], color="blue", label="elbow")
cocofest/examples/dynamics/cycling/inverse_kinematics_cycling.py on lines 47..47

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 37.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

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

                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

                    Similar blocks of code found in 7 locations. Consider refactoring.
                    Open

                    for i in range(n_stim):
                        objective_functions.add(ObjectiveFcn.Lagrange.MINIMIZE_CONTROL, key="tau", weight=1, quadratic=True, phase=i)
                    cocofest/examples/dynamics/cycling/cycling_fes_driven.py on lines 26..27
                    cocofest/examples/dynamics/intensity_optimization_cycling_multi_muscle.py on lines 30..31
                    cocofest/examples/dynamics/minimize_fatigue/frequecy_optimization_minimize_fatigue.py on lines 35..36
                    cocofest/examples/getting_started/frequency_optimization_musculoskeletal_dynamic.py on lines 19..20
                    cocofest/examples/getting_started/pulse_duration_optimization_musculoskeletal_dynamic.py on lines 19..20
                    cocofest/examples/getting_started/pulse_intensity_optimization_musculoskeletal_dynamic.py on lines 19..20

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 36.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 7 locations. Consider refactoring.
                    Open

                    for i in range(n_stim):
                        objective_functions.add(ObjectiveFcn.Lagrange.MINIMIZE_CONTROL, key="tau", weight=1, quadratic=True, phase=i)
                    cocofest/examples/dynamics/cycling/cycling_fes_driven.py on lines 26..27
                    cocofest/examples/dynamics/frequency_optimization_musculoskeletal_dynamic_2dof.py on lines 19..20
                    cocofest/examples/dynamics/intensity_optimization_cycling_multi_muscle.py on lines 30..31
                    cocofest/examples/dynamics/minimize_fatigue/frequecy_optimization_minimize_fatigue.py on lines 35..36
                    cocofest/examples/getting_started/frequency_optimization_musculoskeletal_dynamic.py on lines 19..20
                    cocofest/examples/getting_started/pulse_duration_optimization_musculoskeletal_dynamic.py on lines 19..20

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 36.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Severity
                    Category
                    Status
                    Source
                    Language