workcraft/workcraft

View on GitHub
workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java

Summary

Maintainability
D
3 days
Test Coverage

Avoid too many return statements within this method.
Open

            return 0.0;

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

        private void positionHorizontal(VisualContact vc, boolean reverseProgression) {
            LinkedList<VisualContact> contacts = getOrderedOutsideContacts(vc.getDirection());
            contacts.remove(vc);
            double x = 0.0;
            if (!contacts.isEmpty()) {
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 317..339

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

    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 positionVertical(VisualContact vc, boolean reverseProgression) {
            LinkedList<VisualContact> contacts = getOrderedOutsideContacts(vc.getDirection());
            contacts.remove(vc);
            double y = 0.0;
            if (!contacts.isEmpty()) {
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 293..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 199.

    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

                case NORTH:
                    if (contact.getY() < minBox.getMinY()) {
                        x1 = Math.min(x1, x - contactMargin);
                        x2 = Math.max(x2, x + contactMargin);
                    }
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 392..397
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 404..409
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 410..415

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

                case SOUTH:
                    if (contact.getY() > minBox.getMaxY()) {
                        x1 = Math.min(x1, x - contactMargin);
                        x2 = Math.max(x2, x + contactMargin);
                    }
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 392..397
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 398..403
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 404..409

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

                case EAST:
                    if (contact.getX() > minBox.getMaxX()) {
                        y1 = Math.min(y1, y - contactMargin);
                        y2 = Math.max(y2, y + contactMargin);
                    }
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 392..397
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 398..403
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 410..415

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

                case WEST:
                    if (contact.getX() < minBox.getMinX()) {
                        y1 = Math.min(y1, y - contactMargin);
                        y2 = Math.max(y2, y + contactMargin);
                    }
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 398..403
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 404..409
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 410..415

    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

                case NORTH:
                    double yNorth = contact.getY() + contactLength;
                    if ((yNorth < -size / 2) && (yNorth > yMin)) {
                        yMin = yNorth;
                    }
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 353..358

    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

                case WEST:
                    double xWest = contact.getX() + contactLength;
                    if ((xWest < -size / 2) && (xWest > xMin)) {
                        xMin = xWest;
                    }
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 359..364

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

            for (VisualContact vc: Hierarchy.getChildrenOfType(this, VisualContact.class,
                    contact -> (contact.getDirection() == Direction.NORTH) || (contact.getDirection() == Direction.SOUTH))) {
    
                drawContactName(r, vc);
            }
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 576..580

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

    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 (VisualContact vc: Hierarchy.getChildrenOfType(this, VisualContact.class,
                    contact -> (contact.getDirection() == Direction.WEST) || (contact.getDirection() == Direction.EAST))) {
    
                drawContactName(r, vc);
            }
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 586..590

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

    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

                case EAST:
                    double xEast = contact.getX() - contactLength;
                    if ((xEast > size / 2) && (xEast < xMax)) {
                        xMax = xEast;
                    }
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 371..376

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

    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

                case SOUTH:
                    double ySouth = contact.getY() - contactLength;
                    if ((ySouth > size / 2) && (ySouth < yMax)) {
                        yMax = ySouth;
                    }
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 365..370

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

    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

                case EAST:
                    if (eastFirst) {
                        x2 = x - contactLength;
                    } else {
                        x2 = Math.min(x2, x - contactLength);
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 438..445
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 446..453
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 462..469

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

    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

                case NORTH:
                    if (northFirst) {
                        y1 = y + contactLength;
                    } else {
                        y1 = Math.max(y1, y + contactLength);
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 438..445
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 454..461
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 462..469

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

    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

                case SOUTH:
                    if (southFirst) {
                        y2 = y - contactLength;
                    } else {
                        y2 = Math.min(y2, y - contactLength);
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 438..445
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 446..453
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 454..461

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

    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

                case WEST:
                    if (westFirst) {
                        x1 = x + contactLength;
                    } else {
                        x1 = Math.max(x1, x + contactLength);
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 446..453
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 454..461
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 462..469

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

    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 Rectangle2D getBoundingBoxInLocalSpace() {
            Rectangle2D bb = super.getBoundingBoxInLocalSpace();
            Collection<Touchable> touchableChildren = Hierarchy.getChildrenOfType(this, Touchable.class);
            Rectangle2D childrenBB = BoundingBoxHelper.mergeBoundingBoxes(touchableChildren);
    workcraft/DtdPlugin/src/org/workcraft/plugins/dtd/VisualSignal.java on lines 116..122

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

    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

                    if ((x >= bb.getMaxX()) && (y > bb.getMinY()) && (y < bb.getMaxY())) {
                        vc.setDirection(Direction.EAST);
                    }
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 765..767
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 771..773
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 774..776

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

    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

                    if ((y >= bb.getMaxY()) && (x > bb.getMinX()) && (x < bb.getMaxX())) {
                        vc.setDirection(Direction.SOUTH);
                    }
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 765..767
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 768..770
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 771..773

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

    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

                    if ((y <= bb.getMinY()) && (x > bb.getMinX()) && (x < bb.getMaxX())) {
                        vc.setDirection(Direction.NORTH);
                    }
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 765..767
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 768..770
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 774..776

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

    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

                    if ((x <= bb.getMinX()) && (y > bb.getMinY()) && (y < bb.getMaxY())) {
                        vc.setDirection(Direction.WEST);
                    }
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 768..770
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 771..773
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 774..776

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

    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

            case NORTH:
                double northOffset = contacts.stream().mapToDouble(VisualContact::getY).max().orElse(-contactMinOffset);
                return Math.min(TransformHelper.snapP5(bb.getMinY() - contactLength), northOffset);
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 276..278

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

    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

            case WEST:
                double westOffset = contacts.stream().mapToDouble(VisualContact::getX).max().orElse(-contactMinOffset);
                return Math.min(TransformHelper.snapP5(bb.getMinX() - contactLength), westOffset);
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 279..281

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

    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

            case EAST:
                double eastOffset = contacts.stream().mapToDouble(VisualContact::getX).min().orElse(contactMinOffset);
                return Math.max(TransformHelper.snapP5(bb.getMaxX() + contactLength), eastOffset);
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 285..287

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

    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

            case SOUTH:
                double southOffset = contacts.stream().mapToDouble(VisualContact::getY).min().orElse(contactMinOffset);
                return Math.max(TransformHelper.snapP5(bb.getMaxY() + contactLength), southOffset);
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 282..284

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

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

        public VisualContact getFirstVisualInput() {
            VisualContact result = null;
            for (VisualContact contact: getVisualContacts()) {
                if (contact.isInput()) {
                    result = contact;
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/CircuitComponent.java on lines 90..99
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/CircuitComponent.java on lines 101..110
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 864..873
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualFunctionComponent.java on lines 165..175
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualFunctionComponent.java on lines 177..187

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

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

        public VisualContact getFirstVisualOutput() {
            VisualContact result = null;
            for (VisualContact contact: getVisualContacts()) {
                if (contact.isOutput()) {
                    result = contact;
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/CircuitComponent.java on lines 90..99
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/CircuitComponent.java on lines 101..110
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 853..862
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualFunctionComponent.java on lines 165..175
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualFunctionComponent.java on lines 177..187

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

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

        public List<VisualContact> getVisualInputs() {
            ArrayList<VisualContact> result = new ArrayList<>();
            for (VisualContact contact: getVisualContacts()) {
                if (contact.isInput()) {
                    result.add(contact);
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/CircuitComponent.java on lines 70..78
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/CircuitComponent.java on lines 80..88
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/FunctionComponent.java on lines 82..90
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/FunctionComponent.java on lines 92..100
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 843..851
    workcraft/SonPlugin/src/org/workcraft/plugins/son/ONGroup.java on lines 116..124

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

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

        public Collection<VisualContact> getVisualOutputs() {
            ArrayList<VisualContact> result = new ArrayList<>();
            for (VisualContact contact: getVisualContacts()) {
                if (contact.isOutput()) {
                    result.add(contact);
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/CircuitComponent.java on lines 70..78
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/CircuitComponent.java on lines 80..88
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/FunctionComponent.java on lines 82..90
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/FunctionComponent.java on lines 92..100
    workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 833..841
    workcraft/SonPlugin/src/org/workcraft/plugins/son/ONGroup.java on lines 116..124

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

    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

    There are no issues that match your filters.

    Category
    Status