ArtifactForms/MeshLibCore

View on GitHub

Showing 407 of 407 total issues

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

  public Bounds3 calculateBounds() {
    if (vertices.isEmpty()) return new Bounds3();

    Vector3f min = new Vector3f(getVertexAt(0));
    Vector3f max = new Vector3f(getVertexAt(0));
Severity: Minor
Found in src/main/java/mesh/Mesh3D.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

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

  private void drawBuffer(SceneObject sceneObject) {
    PGraphics3D context = g3d;
    Mesh3D mesh = sceneObject.getMesh();

    int c = -1;
Severity: Minor
Found in src/main/java/workspace/render/ObjectSelectionRender.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

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

  @Override
  public void update() {
    if (activeScene != null) {

      if (input.isKeyPressed(Key.Z) && !lastZ) {
Severity: Minor
Found in src/main/java/engine/application/BasicApplication.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

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

    @Override
    public Mesh3D create() {
        Mesh3D mesh = new Mesh3D();

        float a = 1.0f;

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

        @Override
        public Mesh3D create() {
            Mesh3D mesh = new Mesh3D();
    
            float a = 1.0f;
    Severity: Minor
    Found in src/main/java/mesh/creator/archimedian/TruncatedCubeCreator.java - About 1 hr to fix

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

          public void rotateRightArm(float x, float y, float z) {
              rightArm.translateY(24 * unit);
      
              rightArm.apply(new RotateXModifier(-rotationRightArm.getZ()));
              rightArm.rotateY(-rotationRightArm.getY());
      Severity: Major
      Found in src/main/java/mesh/creator/assets/SteveModel.java and 1 other location - About 1 hr to fix
      src/main/java/mesh/creator/assets/SteveModel.java on lines 57..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 110.

      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 rotateLeftArm(float x, float y, float z) {
              leftArm.translateY(24 * unit);
      
              leftArm.apply(new RotateXModifier(-rotationLeftArm.getZ()));
              leftArm.rotateY(-rotationLeftArm.getY());
      Severity: Major
      Found in src/main/java/mesh/creator/assets/SteveModel.java and 1 other location - About 1 hr to fix
      src/main/java/mesh/creator/assets/SteveModel.java on lines 73..87

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

      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

      package workspace.examples;
      
      import mesh.Mesh3D;
      import mesh.creator.primitives.CubeCreator;
      import processing.core.PApplet;
      Severity: Major
      Found in src/main/java/workspace/examples/WorkspaceTemplate.java and 1 other location - About 1 hr to fix
      src/main/java/workspace/examples/HelloWorkspace.java on lines 1..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 109.

      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

      package workspace.examples;
      
      import mesh.Mesh3D;
      import mesh.creator.primitives.SegmentedCubeCreator;
      import processing.core.PApplet;
      Severity: Major
      Found in src/main/java/workspace/examples/HelloWorkspace.java and 1 other location - About 1 hr to fix
      src/main/java/workspace/examples/WorkspaceTemplate.java on lines 1..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 109.

      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 bridge(Mesh3D m0, Mesh3D m1) {
              for (int i = 0; i < vertices; i++) {
                  Vector3f v0 = m1.getVertexAt(i);
                  Vector3f v1 = m1.getVertexAt((i + 1) % vertices);
                  Vector3f v2 = m0.getVertexAt(i);
      Severity: Major
      Found in src/main/java/mesh/creator/primitives/CylinderCreator.java and 1 other location - About 1 hr to fix
      src/main/java/mesh/creator/creative/RingCageCreator.java on lines 99..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 109.

      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 bridge(Mesh3D m0, Mesh3D m1) {
              for (int i = 0; i < vertices; i++) {
                  Vector3f v0 = m1.getVertexAt(i);
                  Vector3f v1 = m1.getVertexAt((i + 1) % vertices);
                  Vector3f v2 = m0.getVertexAt(i);
      Severity: Major
      Found in src/main/java/mesh/creator/creative/RingCageCreator.java and 1 other location - About 1 hr to fix
      src/main/java/mesh/creator/primitives/CylinderCreator.java on lines 35..43

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

      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 equals has a Cognitive Complexity of 13 (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/util/Bounds3.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

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

          g.applyMatrix(
              values[0],
              values[1],
              values[2],
              values[3],
      Severity: Major
      Found in src/main/java/workspace/GraphicsPImpl.java and 1 other location - About 1 hr to fix
      src/main/java/workspace/GraphicsPImpl.java on lines 99..115

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

      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

          g.applyMatrix(
              matrix[0],
              matrix[1],
              matrix[2],
              matrix[3],
      Severity: Major
      Found in src/main/java/workspace/GraphicsPImpl.java and 1 other location - About 1 hr to fix
      src/main/java/workspace/GraphicsPImpl.java on lines 511..527

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

      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

          protected void addFace(String[] sArray) {
              Face3D f = null;
              int[] iArray = new int[sArray.length - 1];
              for (int i = 0; i < iArray.length; i++) {
                  iArray[i] = Integer.parseInt(sArray[i + 1]) - 1;
      Severity: Major
      Found in src/main/java/mesh/io/SimpleObjectReader.java and 1 other location - About 1 hr to fix
      src/main/java/mesh/io/SimpleObjectsReader.java on lines 28..36

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

      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

          protected void addFace(String[] sArray) {
              Face3D f = null;
              int[] iArray = new int[sArray.length - 1];
              for (int i = 0; i < iArray.length; i++) {
                  iArray[i] = Integer.parseInt(sArray[i + 1]) - 1;
      Severity: Major
      Found in src/main/java/mesh/io/SimpleObjectsReader.java and 1 other location - About 1 hr to fix
      src/main/java/mesh/io/SimpleObjectReader.java on lines 56..64

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

      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 subtract(Color color, Color result) {
          if (result == null) result = new Color();
          result.r = this.r - color.r;
          result.g = this.g - color.g;
          result.b = this.b - color.b;
      Severity: Major
      Found in src/main/java/math/Color.java and 1 other location - About 1 hr to fix
      src/main/java/math/Color.java on lines 134..141

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

      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 add(Color color, Color result) {
          if (result == null) result = new Color();
          result.r = this.r + color.r;
          result.g = this.g + color.g;
          result.b = this.b + color.b;
      Severity: Major
      Found in src/main/java/math/Color.java and 1 other location - About 1 hr to fix
      src/main/java/math/Color.java on lines 210..217

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

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

        private void drawFacesBuffer(Mesh3D mesh, Collection<Face3D> faces) {
          PGraphics3D context = g3d;
      
          context.pushMatrix();
      
      
      Severity: Minor
      Found in src/main/java/workspace/render/SelectionRenderer.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

      Method drawFacesColored has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

        public void drawFacesColored(Mesh3D mesh) {
          context.pushMatrix();
          for (Face3D f : mesh.faces) {
            context.fill(f.color.getRedInt(), f.color.getGreenInt(), f.color.getBlueInt());
      
      
      Severity: Minor
      Found in src/main/java/workspace/render/Mesh3DRenderer.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