ArtifactForms/MeshLibCore

View on GitHub

Showing 407 of 407 total issues

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

    for (int i = 0; i < mesh.vertices.size(); i++) {
      Vector3f v = mesh.vertices.get(i);
      context.vertex(v.getX(), v.getY(), v.getZ());
    }
Severity: Minor
Found in src/main/java/workspace/render/Mesh3DRenderer.java and 1 other location - About 45 mins to fix
src/main/java/workspace/render/Mesh3DRenderer.java on lines 39..42

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

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

  @Override
  public void drawRoundRect(float x, float y, float width, float height, float radii) {
    g.pushStyle();
    g.noFill();
    stroke();
Severity: Minor
Found in src/main/java/workspace/GraphicsPImpl.java and 1 other location - About 45 mins to fix
src/main/java/workspace/GraphicsPImpl.java on lines 242..250

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

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 Vector3f minLocal(Vector3f v) {
    x = Math.min(x, v.x);
    y = Math.min(y, v.y);
    z = Math.min(z, v.z);
    return this;
Severity: Minor
Found in src/main/java/math/Vector3f.java and 1 other location - About 45 mins to fix
src/main/java/math/Vector3f.java on lines 399..404

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

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

        c[M22] = a[M20] * b[M02] + a[M21] * b[M12] + a[M22] * b[M22];
Severity: Major
Found in src/main/java/math/Matrix3f.java and 8 other locations - About 45 mins to fix
src/main/java/math/Matrix3f.java on lines 70..70
src/main/java/math/Matrix3f.java on lines 71..71
src/main/java/math/Matrix3f.java on lines 72..72
src/main/java/math/Matrix3f.java on lines 73..73
src/main/java/math/Matrix3f.java on lines 74..74
src/main/java/math/Matrix3f.java on lines 75..75
src/main/java/math/Matrix3f.java on lines 76..76
src/main/java/math/Matrix3f.java on lines 77..77

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

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 Color addLocal(Color color) {
    this.r += color.r;
    this.g += color.g;
    this.b += color.b;
    this.a += color.a;
Severity: Minor
Found in src/main/java/math/Color.java and 1 other location - About 45 mins to fix
src/main/java/math/Color.java on lines 240..246

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

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

  @Override
  public void fillRoundRect(float x, float y, float width, float height, float radii) {
    g.pushStyle();
    g.noStroke();
    fill();
Severity: Minor
Found in src/main/java/workspace/GraphicsPImpl.java and 1 other location - About 45 mins to fix
src/main/java/workspace/GraphicsPImpl.java on lines 232..240

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

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

  public void drawLine(float x1, float y1, float z1, float x2, float y2, float z2) {
Severity: Minor
Found in src/main/java/workspace/GraphicsPImpl.java - About 45 mins to fix

    Method drawLine has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        void drawLine(float x1, float y1, float z1, float x2, float y2, float z2);
    Severity: Minor
    Found in src/main/java/workspace/ui/Graphics3D.java - About 45 mins to fix

      Method selectRegion has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public void selectRegion(float minX, float maxX, float minY, float maxY,
                  float minZ, float maxZ) {
      Severity: Minor
      Found in src/main/java/mesh/selection/FaceSelection.java - About 45 mins to fix

        Method renderAlignedText has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

              Graphics g, String key, String value, int x, int y, int columnWidth) {
        Severity: Minor
        Found in src/main/java/engine/debug/DebugOverlay.java - About 45 mins to fix

          Method setMaterial has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            @Override
            public void setMaterial(Material material) {
              if (material == null) {
                System.err.println("Warning: Null material passed to setMaterial().");
                return;
          Severity: Minor
          Found in src/main/java/workspace/GraphicsPImpl.java - About 45 mins 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

          Method isValid has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              @Override
              public boolean isValid(Mesh3D mesh, Face3D face) {
                  valid = mode == Mode.AND ? true : false;
          
                  for (IFaceSelectionRule rule : rules) {
          Severity: Minor
          Found in src/main/java/mesh/selection/FaceSelectionRules.java - About 45 mins 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

          Method update has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            public void update(float deltaTime) {
              if (burstMode) {
                emitBurst();
              } else {
                timeSinceLastEmission += deltaTime;
          Severity: Minor
          Found in src/main/java/engine/render/effects/ParticleEmitter.java - About 45 mins 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

          Method removeRegion has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public void removeRegion(float minX, float maxX, float minY, float maxY,
                      float minZ, float maxZ) {
          Severity: Minor
          Found in src/main/java/mesh/selection/FaceSelection.java - About 45 mins to fix

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

                private void createVeticesAtSegmentHeightLevel() {
                    addVertex(-segmentWidthHalf, -segmentHeight, 0);
                    addVertex(-doorWidthHalf, -segmentHeight, 0);
                    addVertex(doorWidthHalf, -segmentHeight, 0);
                    addVertex(segmentWidthHalf, -segmentHeight, 0);
            src/main/java/mesh/creator/assets/ModularKitDoorSegmentCreator.java on lines 65..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 55.

            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 createVerticesAtDoorHeightLevel() {
                    addVertex(-segmentWidthHalf, -doorHeight, 0);
                    addVertex(-doorWidthHalf, -doorHeight, 0);
                    addVertex(doorWidthHalf, -doorHeight, 0);
                    addVertex(segmentWidthHalf, -doorHeight, 0);
            src/main/java/mesh/creator/assets/ModularKitDoorSegmentCreator.java on lines 72..77

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

            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 Edge3D createEdgeAt(Face3D face, int i) {
                    int fromIndex = face.indices[i];
                    int toIndex = face.indices[(i + 1) % face.indices.length];
                    return new Edge3D(fromIndex, toIndex);
                }
            Severity: Minor
            Found in src/main/java/mesh/modifier/SolidifyModifier.java and 1 other location - About 45 mins to fix
            src/main/java/mesh/modifier/subdivision/CatmullClarkModifier.java on lines 98..102

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

            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 Edge3D createEdgeAt(Face3D face, int index) {
                    int fromIndex = face.indices[index];
                    int toIndex = face.indices[(index + 1) % face.indices.length];
                    return new Edge3D(fromIndex, toIndex);
                }
            src/main/java/mesh/modifier/SolidifyModifier.java on lines 169..173

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

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

                private void createTopFaces() {
                    addFace(2, 0, 1);
                    addFace(1, 0, 5);
                    addFace(3, 0, 2);
                    addFace(4, 0, 3);
            Severity: Major
            Found in src/main/java/mesh/creator/platonic/IcosahedronCreator.java and 3 other locations - About 45 mins to fix
            src/main/java/mesh/creator/platonic/IcosahedronCreator.java on lines 69..75
            src/main/java/mesh/creator/platonic/IcosahedronCreator.java on lines 77..83
            src/main/java/mesh/creator/platonic/IcosahedronCreator.java on lines 93..99

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

            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 createTorus() {
                    TorusCreator creator = new TorusCreator();
                    creator.setMajorRadius(majorRadius);
                    creator.setMinorRadius(minorRadius);
                    creator.setMajorSegments(majorSegments);
            Severity: Minor
            Found in src/main/java/mesh/creator/creative/TorusCageCreator.java and 1 other location - About 45 mins to fix
            src/main/java/mesh/creator/primitives/LatticeCreator.java on lines 50..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 53.

            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