Erdnaxela3/bioptim_gui

View on GitHub

Showing 105 of 105 total issues

Function adapt_dynamics has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def adapt_dynamics(phase: dict, dynamics: str) -> None:
    control_names = DefaultVariablesConfig.dynamics_control.values()
    control = DefaultVariablesConfig.dynamics_control[dynamics]

    for argument in objective_key_arguments_iterator(phase):
Severity: Minor
Found in api/bioptim_gui_api/acrobatics_ocp/misc/dynamics_updating.py - About 25 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 objective_key_arguments_iterator has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def objective_key_arguments_iterator(phase: dict) -> dict:
    """
    Iterates over the arguments of the objectives of the given phase

    Parameters
Severity: Minor
Found in api/bioptim_gui_api/acrobatics_ocp/misc/dynamics_updating.py - About 25 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 get_dofs_name has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def get_dofs_name(nb_q):
    # vanilla, with vision, with spine, with spine and vision
    straight_nb_q = [10, 14, 22, 26]
    pike_nb_q = [16, 20, 28, 32]
    tuck_nb_q = [17, 21, 29, 33]
Severity: Minor
Found in gui/graph_multiple_sols.py - About 25 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 register_put_nb_somersaults has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def register_put_nb_somersaults(self):
        @self.router.put("/nb_somersaults", response_model=NbSomersaultsResponse)
        def update_nb_somersaults(nb_somersaults: NbSomersaultsRequest):
            """
            Append or pop the half_twists list

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 var_bounds_list has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def var_bounds_list(data: dict, variable_name: str, var_type: BioptimVariable) -> list[dict]:
    """
    Return the list of all phases bounds (min and max) and interpolation type for the given variable

    Parameters
Severity: Minor
Found in api/bioptim_gui_api/acrobatics_ocp/variables/utils.py - About 25 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 var_initial_guess_list has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def var_initial_guess_list(data: dict, variable_name: str, var_type: BioptimVariable) -> list[dict]:
    """
    Return the list of all phases initial guess and interpolation type for the given variable

    Parameters
Severity: Minor
Found in api/bioptim_gui_api/acrobatics_ocp/variables/utils.py - About 25 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

File not formatted according to black style guide
Open

        super().__init__(data, "state_variables")

File not formatted according to black style guide
Open

    return ret

File not formatted according to black style guide
Open

    return constraints

File not formatted according to black style guide
Open

    return objectives

File not formatted according to black style guide
Open

        pass  # disable

File not formatted according to black style guide
Open

        return x_bounds

File not formatted according to black style guide
Open

    main()
Severity: Minor
Found in gui/graph_multiple_sols.py by black

File not formatted according to black style guide
Open

            return objective

File not formatted according to black style guide
Open

    ]

File not formatted according to black style guide
Open

router.include_router(code_generation_router)

File not formatted according to black style guide
Open

    return constraints

File not formatted according to black style guide
Open

            )

File not formatted according to black style guide
Open

    )

File not formatted according to black style guide
Open

        return ret
Severity
Category
Status
Source
Language