Showing 149 of 149 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
- Create a ticketCreate a ticket
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
- Create a ticketCreate a ticket
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.
- Create a ticketCreate a ticket
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
- Create a ticketCreate a ticket
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
- Create a ticketCreate a ticket
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
- Create a ticketCreate a ticket
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
- Create a ticketCreate a ticket
File inverse_kinematics.py
has 526 lines of code (exceeds 250 allowed). Consider refactoring. Open
import numpy as np
from casadi import vertcat, horzcat, MX, Function, sum1
from typing import Callable
from .enums import InitialGuessModeType
- Create a ticketCreate a ticket
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
- Create a ticketCreate a ticket
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
- Create a ticketCreate a ticket
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
- Create a ticketCreate a ticket
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
- Create a ticketCreate a ticket
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
- Create a ticketCreate a ticket
File animations.py
has 370 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Example script for animating markers
"""
from enum import Enum
- Create a ticketCreate a ticket
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
- Create a ticketCreate a ticket
Identical blocks of code found in 2 locations. Consider refactoring. Open
class JointType(Enum):
"""
This class represents the different types of joints
"""
- Read upRead up
- Create a ticketCreate a ticket
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
class JointType(Enum):
"""
This class represents the different types of joints
"""
- Read upRead up
- Create a ticketCreate a ticket
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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
- Create a ticketCreate a ticket
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
- Create a ticketCreate a ticket
NaturalSegment
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
class NaturalSegment(AbstractNaturalSegment):
"""
Class used to define anatomical segment based on natural coordinate.
Methods
- Create a ticketCreate a ticket