Showing 153 of 153 total issues

File joints.py has 691 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import numpy as np

from .natural_coordinates import SegmentNaturalCoordinates
from .natural_marker import NaturalMarker
from .natural_segment import NaturalSegment
Severity: Major
Found in bionc/bionc_numpy/joints.py - About 1 day to fix

File natural_segment.py has 676 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from typing import Union, Tuple, Callable

import numpy as np
from numpy import cos, zeros, sum, dot, transpose
from numpy.linalg import inv
Severity: Major
Found in bionc/bionc_numpy/natural_segment.py - About 1 day to fix

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 natural_segment.py has 593 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from typing import Union, Tuple

import numpy as np
from casadi import MX
from casadi import cos, transpose, vertcat, inv, dot, sum1, horzcat, solve
Severity: Major
Found in bionc/bionc_casadi/natural_segment.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

File joints.py has 577 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import numpy as np
from casadi import MX, dot, cos, transpose, sumsqr

from .natural_coordinates import SegmentNaturalCoordinates
from .natural_marker import NaturalMarker
Severity: Major
Found in bionc/bionc_casadi/joints.py - About 1 day to fix

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

from typing import Any

import numpy as np
from numpy import transpose

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

File inverse_kinematics.py has 544 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from typing import Callable

import numpy as np
from casadi import vertcat, horzcat, MX, Function, sum1

Severity: Major
Found in bionc/bionc_numpy/inverse_kinematics.py - About 1 day to fix

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

import numpy as np
from casadi import MX, transpose, horzcat, vertcat, solve
from typing import Any

from .biomechanical_model_joints import BiomechanicalModelJoints
Severity: Major
Found in bionc/bionc_casadi/biomechanical_model.py - About 1 day to fix

File joints_with_ground.py has 497 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import numpy as np

from .cartesian_vector import CartesianVector
from .natural_coordinates import SegmentNaturalCoordinates
from .natural_segment import NaturalSegment
Severity: Minor
Found in bionc/bionc_numpy/joints_with_ground.py - About 7 hrs to fix

File natural_segment.py has 422 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import numpy as np
from abc import ABC, abstractmethod
from casadi import MX
from typing import Union

Severity: Minor
Found in bionc/protocols/natural_segment.py - About 6 hrs to fix

AbstractNaturalSegment has 43 functions (exceeds 20 allowed). Consider refactoring.
Open

class AbstractNaturalSegment(ABC):
    """
    This class represents a generic natural segment for both MX and numpy

    Attributes
Severity: Minor
Found in bionc/protocols/natural_segment.py - About 5 hrs to fix

File joints_with_ground.py has 388 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from casadi import MX, dot, cos, transpose, vertcat
import numpy as np

from .natural_segment import NaturalSegment
from .natural_coordinates import SegmentNaturalCoordinates
Severity: Minor
Found in bionc/bionc_casadi/joints_with_ground.py - About 5 hrs to fix

File animations.py has 370 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""
Example script for animating markers
"""

from enum import Enum
Severity: Minor
Found in bionc/vizualization/animations.py - About 4 hrs to fix

File natural_marker.py has 353 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from typing import Callable

import numpy as np

from .biomechanical_model import BiomechanicalModel
Severity: Minor
Found in bionc/bionc_numpy/natural_marker.py - About 4 hrs to fix

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

class JointType(Enum):
    """
    This class represents the different types of joints
    """

Severity: Major
Found in bionc/bionc_casadi/enums.py and 1 other location - About 4 hrs to fix
bionc/bionc_numpy/enums.py on lines 7..23

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 77.

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

class JointType(Enum):
    """
    This class represents the different types of joints
    """

Severity: Major
Found in bionc/bionc_numpy/enums.py and 1 other location - About 4 hrs to fix
bionc/bionc_casadi/enums.py on lines 6..22

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 77.

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

File biomechanical_model_joints.py has 334 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from abc import ABC, abstractmethod
from typing import Any

from .biomechanical_model_segments import GenericBiomechanicalModelSegments
from .natural_coordinates import NaturalCoordinates
Severity: Minor
Found in bionc/protocols/biomechanical_model_joints.py - About 4 hrs to fix

File natural_marker.py has 329 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from typing import Callable

import numpy as np
from casadi import MX, vertcat, horzcat

Severity: Minor
Found in bionc/bionc_casadi/natural_marker.py - About 3 hrs to fix

NaturalSegment has 31 functions (exceeds 20 allowed). Consider refactoring.
Open

class NaturalSegment(AbstractNaturalSegment):
    """
        Class used to define anatomical segment based on natural coordinate.

    Methods
Severity: Minor
Found in bionc/bionc_casadi/natural_segment.py - About 3 hrs to fix
Severity
Category
Status
Source
Language