ArtifactForms/MeshLibCore

View on GitHub

Showing 407 of 407 total issues

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

    inv[8] =
        values[0] * values[11] * values[14]
            - values[0] * values[10] * values[15]
            - values[2] * values[7] * values[15]
            + values[2] * values[5] * values[15]
Severity: Major
Found in src/main/java/math/Matrix4f.java and 1 other location - About 2 hrs to fix
src/main/java/math/Matrix4f.java on lines 104..110

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

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

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

    inv[0] =
        values[5] * values[10] * values[15]
            - values[5] * values[11] * values[14]
            - values[9] * values[6] * values[15]
            + values[9] * values[7] * values[14]
Severity: Major
Found in src/main/java/math/Matrix4f.java and 1 other location - About 2 hrs to fix
src/main/java/math/Matrix4f.java on lines 126..132

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

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

TubeCreator has 22 methods (exceeds 20 allowed). Consider refactoring.
Open

public class TubeCreator implements IMeshCreator {

    private int vertices;

    private float topOuterRadius;
Severity: Minor
Found in src/main/java/mesh/creator/primitives/TubeCreator.java - About 2 hrs to fix

    MobiusStripCreator has 22 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class MobiusStripCreator implements IMeshCreator {
    
        private int rings;
    
        private int segments;
    Severity: Minor
    Found in src/main/java/mesh/creator/special/MobiusStripCreator.java - About 2 hrs to fix

      RippleModifier has 22 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public class RippleModifier implements IMeshModifier {
      
          /**
           * Represents the time progression of the ripple. Higher values simulate wave
           * movement over time.
      Severity: Minor
      Found in src/main/java/mesh/modifier/RippleModifier.java - About 2 hrs to fix

        CrateCreator has 22 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public class CrateCreator implements IMeshCreator {
        
            private float radius;
        
            private float crossBeamRadius;
        Severity: Minor
        Found in src/main/java/mesh/creator/assets/CrateCreator.java - About 2 hrs to fix

          LeonardoCubeCreator has 22 methods (exceeds 20 allowed). Consider refactoring.
          Open

          public class LeonardoCubeCreator implements IMeshCreator {
          
              private float innerRadius;
          
              private float outerRadius;
          Severity: Minor
          Found in src/main/java/mesh/creator/creative/LeonardoCubeCreator.java - About 2 hrs to fix

            File WorkspaceModel.java has 261 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            package workspace;
            
            import java.util.ArrayList;
            import java.util.List;
            
            
            Severity: Minor
            Found in src/main/java/workspace/WorkspaceModel.java - About 2 hrs to fix

              Graphics3D has 21 methods (exceeds 20 allowed). Consider refactoring.
              Open

              public interface Graphics3D extends Graphics2D {
              
                  void translate(float x, float y, float z);
              
                  void scale(float sx, float sy, float sz);
              Severity: Minor
              Found in src/main/java/workspace/ui/Graphics3D.java - About 2 hrs to fix

                TubeLatticeCreator has 21 methods (exceeds 20 allowed). Consider refactoring.
                Open

                public class TubeLatticeCreator implements IMeshCreator {
                
                    private int segments;
                
                    private int vertices;
                Severity: Minor
                Found in src/main/java/mesh/creator/unsorted/TubeLatticeCreator.java - About 2 hrs to fix

                  DiamondCreator has 21 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  public class DiamondCreator implements IMeshCreator {
                  
                      private int segments;
                  
                      private float girdleRadius;
                  Severity: Minor
                  Found in src/main/java/mesh/creator/special/DiamondCreator.java - About 2 hrs to fix

                    ModularKitDoorSegmentCreator has 21 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    public class ModularKitDoorSegmentCreator implements IMeshCreator {
                    
                        private float doorWidth;
                    
                        private float doorHeight;
                    Severity: Minor
                    Found in src/main/java/mesh/creator/assets/ModularKitDoorSegmentCreator.java - About 2 hrs to fix

                      CubeJointLatticeCylinderCreator has 21 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      public class CubeJointLatticeCylinderCreator implements IMeshCreator {
                      
                          private int vertices;
                      
                          private int subdivisionsY;

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

                          public void onKeyReleased(char key) {
                            if (key == 'w' || key == 'W') forward = false;
                        
                            if (key == 's' || key == 'S') back = false;
                        
                        
                        Severity: Major
                        Found in src/main/java/workspace/FirstPersonView.java and 1 other location - About 2 hrs to fix
                        src/main/java/workspace/FirstPersonView.java on lines 95..107

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

                        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

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

                          public void onKeyPressed(char key) {
                            if (key == 'w' || key == 'W') forward = true;
                        
                            if (key == 's' || key == 'S') back = true;
                        
                        
                        Severity: Major
                        Found in src/main/java/workspace/FirstPersonView.java and 1 other location - About 2 hrs to fix
                        src/main/java/workspace/FirstPersonView.java on lines 109..121

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

                        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

                        Method create has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            @Override
                            public Mesh3D create() {
                                Mesh3D mesh = new Mesh3D();
                        
                                float a = 1.0f;

                          Method equals has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                          Open

                                  @Override
                                  public boolean equals(Object obj) {
                                      if (this == obj)
                                          return true;
                                      if (obj == null)
                          Severity: Minor
                          Found in src/main/java/mesh/modifier/subdivision/DooSabinModifier.java - About 1 hr 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

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

                              public Matrix3f set(float m00, float m01, float m02, float m10, float m11,
                                      float m12, float m20, float m21, float m22) {
                                  values[M00] = m00;
                                  values[M01] = m01;
                                  values[M02] = m02;
                          Severity: Major
                          Found in src/main/java/math/Matrix3f.java and 1 other location - About 1 hr to fix
                          src/main/java/math/Matrix3f.java on lines 113..125

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

                          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

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

                              public Matrix3f addLocal(float m00, float m01, float m02, float m10,
                                      float m11, float m12, float m20, float m21, float m22) {
                                  values[M00] += m00;
                                  values[M01] += m01;
                                  values[M02] += m02;
                          Severity: Major
                          Found in src/main/java/math/Matrix3f.java and 1 other location - About 1 hr to fix
                          src/main/java/math/Matrix3f.java on lines 187..199

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

                          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

                          Method intersectsRay has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                          Open

                            public boolean intersectsRay(Ray3f ray) {
                              if (ray.getDirection().isZero()) {
                                return false; // A ray with zero direction cannot intersect anything
                              }
                          
                          
                          Severity: Minor
                          Found in src/main/java/math/Bounds.java - About 1 hr 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

                          Severity
                          Category
                          Status
                          Source
                          Language