bionc/protocols/biomechanical_model.py

Summary

Maintainability
D
2 days
Test Coverage

GenericBiomechanicalModel has 70 functions (exceeds 20 allowed). Consider refactoring.
Open

class GenericBiomechanicalModel(ABC):
    """
    This is an abstract base class that provides the basic structure and methods for all biomechanical models.
    It contains the segments and the joints of the model. The implemented methods are not specific to numpy or casadi.

Severity: Major
Found in bionc/protocols/biomechanical_model.py - About 1 day to fix

File biomechanical_model.py has 587 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from abc import ABC, abstractmethod
from typing import Union, Any

import dill as pickle
import numpy as np
Severity: Major
Found in bionc/protocols/biomechanical_model.py - About 1 day to fix

Function set_ground_segment has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def set_ground_segment(self, name: str):
        """
        This function sets the ground segment of the model

        Parameters
Severity: Minor
Found in bionc/protocols/biomechanical_model.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

There are no issues that match your filters.

Category
Status