ArtifactForms/MeshLibCore

View on GitHub

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;
    Severity: Minor
    Found in src/main/java/workspace/ui/UiComponent.java - About 4 hrs to fix

      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);
      
      
      Severity: Minor
      Found in src/main/java/math/Color.java - About 4 hrs to fix

        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);
        src/main/java/mesh/creator/catalan/TriakisOctahedronCreator.java on lines 47..72

        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

        Further Reading

        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);
        src/main/java/mesh/creator/catalan/TetrakisHexahedronCreator.java on lines 46..71

        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

        Further Reading

        ArchCreator has 31 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public class ArchCreator implements IMeshCreator {
        
            private int segments;
        
            private float radius;
        Severity: Minor
        Found in src/main/java/mesh/creator/assets/ArchCreator.java - About 3 hrs to fix

          Mesh3D has 31 methods (exceeds 20 allowed). Consider refactoring.
          Open

          public class Mesh3D {
          
            public ArrayList<Vector3f> vertices;
            public ArrayList<Face3D> faces;
          
          
          Severity: Minor
          Found in src/main/java/mesh/Mesh3D.java - About 3 hrs to fix

            SolidArcCreator has 29 methods (exceeds 20 allowed). Consider refactoring.
            Open

            public class SolidArcCreator implements IMeshCreator {
            
                private int index;
            
                private int vertices;
            Severity: Minor
            Found in src/main/java/mesh/creator/primitives/SolidArcCreator.java - About 3 hrs to fix

              StairsCreator has 28 methods (exceeds 20 allowed). Consider refactoring.
              Open

              public class StairsCreator implements IMeshCreator {
              
                  private int nextIndex;
              
                  private Mesh3D mesh;
              Severity: Minor
              Found in src/main/java/mesh/creator/assets/StairsCreator.java - About 3 hrs to fix

                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);
                Severity: Minor
                Found in src/main/java/mesh/animator/Morpher.java - About 3 hrs 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

                CubeJointLatticeCreator has 27 methods (exceeds 20 allowed). Consider refactoring.
                Open

                public class CubeJointLatticeCreator implements IMeshCreator {
                
                    private int subdivisionsX;
                
                    private int subdivisionsY;
                Severity: Minor
                Found in src/main/java/mesh/creator/unsorted/CubeJointLatticeCreator.java - About 3 hrs to fix

                  SegmentedCylinderCreator has 27 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  public class SegmentedCylinderCreator implements IMeshCreator {
                  
                      private float topRadius;
                  
                      private float bottomRadius;
                  Severity: Minor
                  Found in src/main/java/mesh/creator/primitives/SegmentedCylinderCreator.java - About 3 hrs to fix

                    PitchedRoofCreator has 27 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    public class PitchedRoofCreator implements IMeshCreator {
                    
                        private float width;
                    
                        private float height;
                    Severity: Minor
                    Found in src/main/java/mesh/creator/assets/PitchedRoofCreator.java - About 3 hrs to fix

                      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;
                        Severity: Minor
                        Found in src/main/java/mesh/creator/assets/PillarCreator.java - About 3 hrs to fix

                          NubCreator has 26 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                          public class NubCreator implements IMeshCreator {
                          
                              private int subdivisions;
                          
                              private int heightSegments;
                          Severity: Minor
                          Found in src/main/java/mesh/creator/unsorted/NubCreator.java - About 3 hrs to fix

                            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();
                            Severity: Major
                            Found in src/main/java/mesh/Mesh3D.java and 1 other location - About 2 hrs to fix
                            src/main/java/mesh/util/Bounds3.java on lines 48..57

                            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

                            Further Reading

                            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();
                            Severity: Major
                            Found in src/main/java/mesh/util/Bounds3.java and 1 other location - About 2 hrs to fix
                            src/main/java/mesh/Mesh3D.java on lines 98..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 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

                            Further Reading

                            ConeCreator has 25 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                            public class ConeCreator implements IMeshCreator {
                            
                                private int rotationSegments;
                            
                                private int heightSegments;
                            Severity: Minor
                            Found in src/main/java/mesh/creator/primitives/ConeCreator.java - About 2 hrs to fix

                              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);
                              Severity: Major
                              Found in src/main/java/mesh/creator/platonic/DodecahedronCreator.java and 1 other location - About 2 hrs to fix
                              src/main/java/mesh/creator/archimedian/IcosidodecahedronCreator.java on lines 57..70

                              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

                              Further Reading

                              Severity
                              Category
                              Status
                              Source
                              Language