ArtifactForms/MeshLibCore

View on GitHub

Showing 407 of 407 total issues

Method read has a Cognitive Complexity of 11 (exceeds 5 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

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

  public void onKeyReleased(char key) {
    if (key == 'w' || key == 'W') forward = false;

    if (key == 's' || key == 'S') back = false;

Severity: Minor
Found in src/main/java/workspace/FirstPersonView.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 onKeyPressed has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  public void onKeyPressed(char key) {
    if (key == 'w' || key == 'W') forward = true;

    if (key == 's' || key == 'S') back = true;

Severity: Minor
Found in src/main/java/workspace/FirstPersonView.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 createJoints() {
        for (int z = 0; z < cubes[0][0].length; z++)
            for (int y = 0; y < cubes.length; y++)
                for (int x = 0; x < cubes[0].length; x++)
                    createJointAt(x, y, z);
src/main/java/mesh/creator/unsorted/CubeJointLatticeCubeCreator.java on lines 79..84

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

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 connectJoints() {
        for (int z = 0; z < cubes[0][0].length; z++)
            for (int y = 0; y < cubes.length; y++)
                for (int x = 0; x < cubes[0].length; x++)
                    connectJointAt(x, y, z);
src/main/java/mesh/creator/unsorted/CubeJointLatticeCubeCreator.java on lines 66..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 85.

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 onUpdate has 31 lines of code (exceeds 25 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 1 hr to fix

    Method getBorderVerticesFromGrid has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private List<Vector3f> getBorderVerticesFromGrid(Mesh3D grid) {
            float valueX = Mathf.abs(grid.getVertexAt(0).getX());
            float valueZ = Mathf.abs(grid.getVertexAt(0).getZ());
    
            List<Vector3f> vertices0 = new ArrayList<Vector3f>();
    Severity: Minor
    Found in src/main/java/mesh/creator/primitives/QuadCapCylinderCreator.java - About 1 hr to fix

      Method createVertices has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private void createVertices() {
              float y0 = -(turns * dy) / 2f; // Apply offset to center the helix
              float stepY = dy / (float) majorSegments;
              float majorAngle = 0;
              float minorAngle = 0;
      Severity: Minor
      Found in src/main/java/mesh/creator/primitives/HelixCreator.java - About 1 hr to fix

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

            private void addFace(int i, int j) {
                int idx0 = toOneDimensionalIndex(i, j);
                int idx1 = toOneDimensionalIndex(i + 1, j);
                int idx2 = toOneDimensionalIndex(i + 1, j + 1);
                int idx3 = toOneDimensionalIndex(i, j + 1);
        Severity: Major
        Found in src/main/java/mesh/creator/unsorted/NubCreator.java and 3 other locations - About 1 hr to fix
        src/main/java/mesh/creator/primitives/ConeCreator.java on lines 54..60
        src/main/java/mesh/creator/primitives/SegmentedTubeCreator.java on lines 71..77
        src/main/java/mesh/creator/special/VariableCylinderCreator.java on lines 114..120

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

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

            private void addFace(int i, int j) {
                int idx0 = toOneDimensionalIndex(i, j);
                int idx1 = toOneDimensionalIndex(i + 1, j);
                int idx2 = toOneDimensionalIndex(i + 1, j + 1);
                int idx3 = toOneDimensionalIndex(i, j + 1);
        Severity: Major
        Found in src/main/java/mesh/creator/primitives/ConeCreator.java and 3 other locations - About 1 hr to fix
        src/main/java/mesh/creator/primitives/SegmentedTubeCreator.java on lines 71..77
        src/main/java/mesh/creator/special/VariableCylinderCreator.java on lines 114..120
        src/main/java/mesh/creator/unsorted/NubCreator.java on lines 87..93

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

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

            private void addFace(int i, int j) {
                int idx0 = toOneDimensionalIndex(i, j);
                int idx1 = toOneDimensionalIndex(i + 1, j);
                int idx2 = toOneDimensionalIndex(i + 1, j + 1);
                int idx3 = toOneDimensionalIndex(i, j + 1);
        src/main/java/mesh/creator/primitives/ConeCreator.java on lines 54..60
        src/main/java/mesh/creator/special/VariableCylinderCreator.java on lines 114..120
        src/main/java/mesh/creator/unsorted/NubCreator.java on lines 87..93

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

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

            private void addFace(int i, int j) {
                int idx0 = toOneDimensionalIndex(i, j);
                int idx1 = toOneDimensionalIndex(i + 1, j);
                int idx2 = toOneDimensionalIndex(i + 1, j + 1);
                int idx3 = toOneDimensionalIndex(i, j + 1);
        src/main/java/mesh/creator/primitives/ConeCreator.java on lines 54..60
        src/main/java/mesh/creator/primitives/SegmentedTubeCreator.java on lines 71..77
        src/main/java/mesh/creator/unsorted/NubCreator.java on lines 87..93

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

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

            private void createVertices() {
                float a = 1.0f;
                float b = (1.0f / 3.0f)
                        * (Mathf.pow(17 + 3.0f * Mathf.sqrt(33.0f), 1.0f / 3.0f)
                                - Mathf.pow(-17 + 3.0f * Mathf.sqrt(33.0f), 1.0f / 3.0f)
        Severity: Minor
        Found in src/main/java/mesh/creator/archimedian/SnubCubeCreator.java - About 1 hr to fix

          Method getCreator has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected IMeshCreator getCreator() {
                  switch (type) {
                  case ICOSIDODECAHEDRON:
                      return new IcosidodecahedronCreator();
                  case TRUNCATED_CUBOCTAHEDRON:
          Severity: Minor
          Found in src/main/java/mesh/creator/archimedian/ArchimedianSolidCreator.java - About 1 hr to fix

            Method createVertices has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private void createVertices() {
                    addVertex(+a, +a, +b);
                    addVertex(+a, +a, -b);
                    addVertex(+a, +b, +a);
                    addVertex(+a, -b, +a);

              Method drawFacesBuffer has 30 lines of code (exceeds 25 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

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

                        private void createFace(int i) {
                            int originalVertexIndex = face.indices[i];
                            int edgePointIndex0 = indices[i + 1];
                            int facePointIndex = indices[0];
                            int edgePointIndex1 = indices[i == 0 ? face.indices.length : i];
                src/main/java/mesh/modifier/subdivision/LinearSubdivisionModifier.java on lines 89..95

                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

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

                        for (int i = 0; i < face.indices.length; i++) {
                            int index0 = face.indices[i];
                            int index1 = indices[i + 1];
                            int index2 = indices[0];
                            int index3 = indices[i == 0 ? face.indices.length : i];
                src/main/java/mesh/modifier/subdivision/CatmullClarkModifier.java on lines 172..179

                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

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

                    public void selectLeftFaces() {
                        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 295..304
                src/main/java/mesh/selection/FaceSelection.java on lines 328..337

                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

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

                    public void selectTopFaces() {
                        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 328..337

                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

                Severity
                Category
                Status
                Source
                Language