Showing 407 of 407 total issues
Method create
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public Mesh3D create() {
Mesh3D mesh = new Mesh3D();
float a = 0.0f;
UiComponent
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
public class UiComponent implements UiElement {
protected int x;
protected int y;
Color
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
public class Color {
/** Solid black. RGBA is (0, 0, 0, 1). */
public static final Color BLACK = new Color(0f, 0f, 0f, 1f);
Similar blocks of code found in 2 locations. Consider refactoring. Open
public void createFaces() {
addFace(6, 0, 7);
addFace(8, 1, 9);
addFace(10, 0, 11);
addFace(12, 1, 13);
- Read upRead up
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 243.
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
private void createFaces() {
addFace(8, 0, 9);
addFace(1, 8, 9);
addFace(9, 2, 10);
addFace(3, 8, 11);
- Read upRead up
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 243.
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
ArchCreator
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
public class ArchCreator implements IMeshCreator {
private int segments;
private float radius;
Mesh3D
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
public class Mesh3D {
public ArrayList<Vector3f> vertices;
public ArrayList<Face3D> faces;
SolidArcCreator
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
public class SolidArcCreator implements IMeshCreator {
private int index;
private int vertices;
StairsCreator
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
public class StairsCreator implements IMeshCreator {
private int nextIndex;
private Mesh3D mesh;
Method onUpdate
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void onUpdate(float tpf) {
for (int i = 0; i < source.vertices.size(); i++) {
Vector3f v0 = mesh.getVertexAt(i);
Vector3f target = this.target.vertices.get(i);
- 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
CubeJointLatticeCreator
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
public class CubeJointLatticeCreator implements IMeshCreator {
private int subdivisionsX;
private int subdivisionsY;
SegmentedCylinderCreator
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
public class SegmentedCylinderCreator implements IMeshCreator {
private float topRadius;
private float bottomRadius;
PitchedRoofCreator
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
public class PitchedRoofCreator implements IMeshCreator {
private float width;
private float height;
Method create
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public Mesh3D create() {
Mesh3D mesh = new Mesh3D();
float a = 1.0f;
PillarCreator
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
public class PillarCreator implements IMeshCreator {
private int rotationSegments;
private int topSegments;
NubCreator
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
public class NubCreator implements IMeshCreator {
private int subdivisions;
private int heightSegments;
Identical blocks of code found in 2 locations. Consider refactoring. Open
for (Vector3f v : vertices) {
float minX = v.getX() < min.getX() ? v.getX() : min.getX();
float minY = v.getY() < min.getY() ? v.getY() : min.getY();
float minZ = v.getZ() < min.getZ() ? v.getZ() : min.getZ();
float maxX = v.getX() > max.getX() ? v.getX() : max.getX();
- Read upRead up
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 181.
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
public void encapsulate(Vector3f v) {
float minX = v.getX() < min.getX() ? v.getX() : min.getX();
float minY = v.getY() < min.getY() ? v.getY() : min.getY();
float minZ = v.getZ() < min.getZ() ? v.getZ() : min.getZ();
float maxX = v.getX() > max.getX() ? v.getX() : max.getX();
- Read upRead up
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 181.
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
ConeCreator
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
public class ConeCreator implements IMeshCreator {
private int rotationSegments;
private int heightSegments;
Similar blocks of code found in 2 locations. Consider refactoring. Open
private void createFaces() {
addFace(4, 8, 12, 16, 0);
addFace(6, 19, 10, 8, 4);
addFace(10, 3, 14, 12, 8);
addFace(14, 7, 18, 16, 12);
- Read upRead up
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 171.
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