Showing 631 of 631 total issues
File integrator.py
has 664 lines of code (exceeds 250 allowed). Consider refactoring. Open
import numpy as np
from casadi import Function, vertcat, horzcat, collocation_points, tangent, rootfinder, DM, MX, SX, linspace
from ..misc.enums import ControlType, DefectType
from ..models.protocols.biomodel import BioModel
File multinode_penalty.py
has 659 lines of code (exceeds 250 allowed). Consider refactoring. Open
from typing import Callable, Any
from casadi import MX_eye, SX_eye, jacobian, Function, MX, SX, vertcat
from .constraints import PenaltyOption
MultiBiorbdModel
has 74 functions (exceeds 20 allowed). Consider refactoring. Open
class MultiBiorbdModel:
"""
This class allows to define multiple biorbd models for the same phase.
File __main__.py
has 618 lines of code (exceeds 250 allowed). Consider refactoring. Open
# based on https://github.com/pyqtgraph/pyqtgraph/tree/master/pyqtgraph/examples
import keyword
import os
import re
Function generic_dispatch_bounds
has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring. Open
def generic_dispatch_bounds(interface, include_g: bool, include_g_internal: bool, include_g_implicit: bool):
"""
Parse the bounds of the full ocp to a SQP-friendly one
Parameters
- Read upRead up
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 arm_reaching_torque_driven_explicit.py
has 568 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
This example is adapted from arm_reaching_muscle_driven.py to make it torque driven.
The states dynamics is implicit. which allows to minimize the uncertainty on the acceleration of joints.
The algebraic states dynamics is explicit.
"""
File online_callback_server.py
has 566 lines of code (exceeds 250 allowed). Consider refactoring. Open
from enum import IntEnum, StrEnum, auto
import json
import logging
import platform
import socket
File stochastic_optimal_control_program.py
has 564 lines of code (exceeds 250 allowed). Consider refactoring. Open
from typing import Callable
import numpy as np
from casadi import DM_eye, vertcat, Function
File obstacle_avoidance_direct_collocation.py
has 558 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
This example aims to replicate the example provided in Gillis 2013: https://doi.org/10.1109/CDC.2013.6761121.
It consists in a mass-point trying to find a time optimal periodic trajectory around super-ellipse obstacles.
The controls are coordinates of a quide-point (the mass is attached to this guide point with a sping).
"""
File configure_new_variable.py
has 557 lines of code (exceeds 250 allowed). Consider refactoring. Open
from casadi import MX, SX, vertcat
import numpy as np
from .fatigue.fatigue_dynamics import FatigueList, MultiFatigueInterface
from ..gui.plot import CustomPlot
BioModel
has 61 functions (exceeds 20 allowed). Consider refactoring. Open
class BioModel(Protocol):
"""
This protocol defines the minimal set of attributes and methods a model should possess to access every feature of
bioptim.
As a reminder for developers: only necessary attributes and methods should appear here.
File ode_solver.py
has 529 lines of code (exceeds 250 allowed). Consider refactoring. Open
from typing import Callable
from casadi import MX, SX, integrator as casadi_integrator, horzcat, Function, vertcat
from . import integrator
Function from_initial_guess
has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring. Open
def from_initial_guess(cls, ocp, sol: list):
"""
Initialize all the attributes from a list of initial guesses (states, controls)
Parameters
- Read upRead up
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 optimization_variable.py
has 512 lines of code (exceeds 250 allowed). Consider refactoring. Open
from typing import Callable
import numpy as np
from casadi import MX, SX, vertcat
File serializable_class.py
has 507 lines of code (exceeds 250 allowed). Consider refactoring. Open
from typing import Any
from casadi import Function
import numpy as np
File objective_functions.py
has 504 lines of code (exceeds 250 allowed). Consider refactoring. Open
from typing import Callable, Any
from .penalty import PenaltyFunctionAbstract, PenaltyOption
from .penalty_controller import PenaltyController
from ..misc.enums import Node, QuadratureRule, PenaltyType
Function noisy_integrate
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
def noisy_integrate(
self,
integrator: SolutionIntegrator = SolutionIntegrator.OCP,
to_merge: SolutionMerge | list[SolutionMerge] = None,
size: int = 100,
- Read upRead up
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
IPOPT
has 56 functions (exceeds 20 allowed). Consider refactoring. Open
class IPOPT(GenericSolver):
"""
Class for Solver Options of IPOPT
Attributes
Function __set_constraints
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
def __set_constraints(self, ocp):
"""
Set the constraints from the ocp
Parameters
- Read upRead up
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 _manage_fatigue_to_new_variable
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
def _manage_fatigue_to_new_variable(
name: str,
name_elements: list,
ocp,
nlp,
- Read upRead up
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"