ArtifactForms/MeshLibCore

View on GitHub

Showing 407 of 407 total issues

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

    public void selectBackFaces() {
        for (Face3D f : mesh.faces) {
            Vector3f v = mesh.calculateFaceNormal(f);
            Vector3f v0 = new Vector3f(Mathf.round(v.getX()),
                    Mathf.round(v.getY()), Mathf.round(v.getZ()));
Severity: Major
Found in src/main/java/mesh/selection/FaceSelection.java and 2 other locations - About 1 hr to fix
src/main/java/mesh/selection/FaceSelection.java on lines 273..282
src/main/java/mesh/selection/FaceSelection.java on lines 295..304

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

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 read has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public List<Mesh3D> read(File file) {
        meshes = new ArrayList<Mesh3D>();
        vertices = new ArrayList<Vector3f>();

        try {
Severity: Minor
Found in src/main/java/mesh/io/SimpleObjectsReader.java - About 1 hr to fix

    Method drawFacesSmooth has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      private void drawFacesSmooth(Mesh3D mesh, Collection<Face3D> faces) {
        context.pushMatrix();
    
        mesh.apply(new UpdateFaceNormalsModifier());
    
    
    Severity: Minor
    Found in src/main/java/workspace/render/Mesh3DRenderer.java - About 1 hr to fix

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

          public void selectRightFaces() {
              for (Face3D f : mesh.faces) {
                  Vector3f v = mesh.calculateFaceNormal(f);
                  Vector3f v0 = new Vector3f(Mathf.round(v.getX()),
                          Mathf.round(v.getY()), Mathf.round(v.getZ()));
      Severity: Major
      Found in src/main/java/mesh/selection/FaceSelection.java and 2 other locations - About 1 hr to fix
      src/main/java/mesh/selection/FaceSelection.java on lines 306..315
      src/main/java/mesh/selection/FaceSelection.java on lines 317..326

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

      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 3 locations. Consider refactoring.
      Open

          public void selectFrontFaces() {
              for (Face3D f : mesh.faces) {
                  Vector3f v = mesh.calculateFaceNormal(f);
                  Vector3f v0 = new Vector3f(Mathf.round(v.getX()),
                          Mathf.round(v.getY()), Mathf.round(v.getZ()));
      Severity: Major
      Found in src/main/java/mesh/selection/FaceSelection.java and 2 other locations - About 1 hr to fix
      src/main/java/mesh/selection/FaceSelection.java on lines 284..293
      src/main/java/mesh/selection/FaceSelection.java on lines 306..315

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

      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 3 locations. Consider refactoring.
      Open

          public void selectBottomFaces() {
              for (Face3D f : mesh.faces) {
                  Vector3f v = mesh.calculateFaceNormal(f);
                  Vector3f v0 = new Vector3f(Mathf.round(v.getX()),
                          Mathf.round(v.getY()), Mathf.round(v.getZ()));
      Severity: Major
      Found in src/main/java/mesh/selection/FaceSelection.java and 2 other locations - About 1 hr to fix
      src/main/java/mesh/selection/FaceSelection.java on lines 284..293
      src/main/java/mesh/selection/FaceSelection.java on lines 317..326

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

      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 addLocal has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public Matrix3f addLocal(float m00, float m01, float m02, float m10,
                  float m11, float m12, float m20, float m21, float m22) {
      Severity: Major
      Found in src/main/java/math/Matrix3f.java - About 1 hr to fix

        Method add has 9 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public Matrix3f add(float m00, float m01, float m02, float m10, float m11,
                    float m12, float m20, float m21, float m22) {
        Severity: Major
        Found in src/main/java/math/Matrix3f.java - About 1 hr to fix

          Method set has 9 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public Matrix3f set(float m00, float m01, float m02, float m10, float m11,
                      float m12, float m20, float m21, float m22) {
          Severity: Major
          Found in src/main/java/math/Matrix3f.java - About 1 hr to fix

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

              public void pre() {
                if (p.width != this.width || p.height != this.height) {
                  this.width = p.width;
                  this.height = p.height;
                  g3d = (PGraphics3D) p.createGraphics(p.width, p.height, PApplet.P3D);
            Severity: Major
            Found in src/main/java/workspace/render/SelectionRenderer.java and 1 other location - About 1 hr to fix
            src/main/java/workspace/render/ObjectSelectionRender.java on lines 38..44

            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

              public void pre() {
                if (p.width != this.width || p.height != this.height) {
                  this.width = p.width;
                  this.height = p.height;
                  g3d = (PGraphics3D) p.createGraphics(p.width, p.height, PApplet.P3D);
            Severity: Major
            Found in src/main/java/workspace/render/ObjectSelectionRender.java and 1 other location - About 1 hr to fix
            src/main/java/workspace/render/SelectionRenderer.java on lines 31..37

            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

                private void addFace(Vector<Integer> indices) {
                    int[] a = new int[indices.size()];
                    for (int j = 0; j < a.length; j++) {
                        a[a.length - j - 1] = indices.get(j);
                    }
            src/main/java/mesh/creator/special/DualCreator.java on lines 26..32

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

            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

              @Override
              public void render(Light light) {
                switch (light.getType()) {
                  case SPOT:
                    render((SpotLight) light);
            Severity: Major
            Found in src/main/java/engine/processing/LightGizmoRenderer.java and 1 other location - About 1 hr to fix
            src/main/java/engine/processing/LightRendererImpl.java on lines 31..49

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

            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

              @Override
              public void render(Light light) {
                switch (light.getType()) {
                  case SPOT:
                    render((SpotLight) light);
            Severity: Major
            Found in src/main/java/engine/processing/LightRendererImpl.java and 1 other location - About 1 hr to fix
            src/main/java/engine/processing/LightGizmoRenderer.java on lines 34..52

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

            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

                private void addFace(Vector<Integer> indices) {
                    int[] a = new int[indices.size()];
                    for (int j = 0; j < a.length; j++) {
                        a[a.length - j - 1] = indices.get(j);
                    }
            Severity: Major
            Found in src/main/java/mesh/creator/special/DualCreator.java and 1 other location - About 1 hr to fix
            src/main/java/mesh/modifier/subdivision/DooSabinModifier.java on lines 152..158

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

            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 render has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

              public void render(Graphics g) {
                if (!visible) {
                  return;
                }
            
            
            Severity: Minor
            Found in src/main/java/engine/debug/DebugOverlay.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

                private void createFaces() {
                    addFace(3, 0, 1, 2);
                    addFace(6, 5, 4, 7);
                    addFace(1, 0, 4, 5);
                    addFace(1, 5, 6, 2);
            Severity: Major
            Found in src/main/java/mesh/creator/primitives/CubeCreator.java and 1 other location - About 1 hr to fix
            src/main/java/mesh/creator/archimedian/SnubCubeCreator.java on lines 98..105

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

            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 createQuads() {
                    addFace(0, 19, 3, 17);
                    addFace(1, 16, 2, 18);
                    addFace(4, 15, 7, 13);
                    addFace(5, 12, 6, 14);
            Severity: Major
            Found in src/main/java/mesh/creator/archimedian/SnubCubeCreator.java and 1 other location - About 1 hr to fix
            src/main/java/mesh/creator/primitives/CubeCreator.java on lines 43..50

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

            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 render has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              public void render(Graphics g) {
                if (!visible) {
                  return;
                }
            
            
            Severity: Minor
            Found in src/main/java/engine/debug/DebugOverlay.java - About 1 hr to fix

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

                      for (int i = 0; i < face.indices.length; i++) {
                          Vector3f v = mesh.vertices.get(face.indices[i]);
                          Vector3f v0 = v.mult(m);
                          v.set(v0.getX(), v0.getY(), v.getZ());
                      }
              Severity: Major
              Found in src/main/java/mesh/util/Mesh3DUtil.java and 2 other locations - About 1 hr to fix
              src/main/java/mesh/util/Mesh3DUtil.java on lines 44..48
              src/main/java/mesh/util/Mesh3DUtil.java on lines 55..59

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

              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