workcraft/workcraft

View on GitHub

Showing 1,897 of 2,488 total issues

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

            for (VisualSignalTransition t : minus) {
                t.setPosition(new Point2D.Double(minusPos.getX(), minusPos.getY()));
                minusPos.setLocation(minusPos.getX(), minusPos.getY() + instanceDiff);
            }
workcraft/PlatoPlugin/src/org/workcraft/plugins/plato/layout/ConceptsLayout.java on lines 111..114

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

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

        double aX = 3.0 * p3.getX() - 9.0 * p2.getX() + 9.0 * p1.getX() - 3.0 * p0.getX();
Severity: Minor
Found in workcraft/WorkcraftCore/src/org/workcraft/utils/Geometry.java and 1 other location - About 35 mins to fix
workcraft/WorkcraftCore/src/org/workcraft/utils/Geometry.java on lines 231..231

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

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

    public Collection<Condition> getConditions() {
        ArrayList<Condition> result = new ArrayList<>();
        for (Node node : getComponents()) {
            if (node instanceof Condition) {
                result.add((Condition) node);
Severity: Major
Found in workcraft/SonPlugin/src/org/workcraft/plugins/son/ONGroup.java and 7 other locations - About 35 mins to fix
workcraft/DtdPlugin/src/org/workcraft/plugins/dtd/VisualSignal.java on lines 238..246
workcraft/SonPlugin/src/org/workcraft/plugins/son/ONGroup.java on lines 81..90
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 105..114
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 120..129
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 131..140
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 142..151
workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/components/VisualXmasComponent.java on lines 126..134

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

    public Collection<Condition> getConditions() {
        ArrayList<Condition> result = new ArrayList<>();
        for (MathNode node : getComponents()) {
            if (node instanceof Condition) {
                result.add((Condition) node);
Severity: Major
Found in workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java and 7 other locations - About 35 mins to fix
workcraft/DtdPlugin/src/org/workcraft/plugins/dtd/VisualSignal.java on lines 238..246
workcraft/SonPlugin/src/org/workcraft/plugins/son/ONGroup.java on lines 70..79
workcraft/SonPlugin/src/org/workcraft/plugins/son/ONGroup.java on lines 81..90
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 120..129
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 131..140
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 142..151
workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/components/VisualXmasComponent.java on lines 126..134

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

    public Collection<PlaceNode> getPlaceNodes() {
        ArrayList<PlaceNode> result = new ArrayList<>();
        for (MathNode node : getComponents()) {
            if (node instanceof PlaceNode) {
                result.add((PlaceNode) node);
Severity: Major
Found in workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java and 7 other locations - About 35 mins to fix
workcraft/DtdPlugin/src/org/workcraft/plugins/dtd/VisualSignal.java on lines 238..246
workcraft/SonPlugin/src/org/workcraft/plugins/son/ONGroup.java on lines 70..79
workcraft/SonPlugin/src/org/workcraft/plugins/son/ONGroup.java on lines 81..90
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 105..114
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 120..129
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 142..151
workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/components/VisualXmasComponent.java on lines 126..134

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

    public Collection<VisualXmasContact> getContacts() {
        ArrayList<VisualXmasContact> result = new ArrayList<>();
        for (Node n: getChildren()) {
            if (n instanceof VisualXmasContact) {
                result.add((VisualXmasContact) n);
workcraft/DtdPlugin/src/org/workcraft/plugins/dtd/VisualSignal.java on lines 238..246
workcraft/SonPlugin/src/org/workcraft/plugins/son/ONGroup.java on lines 70..79
workcraft/SonPlugin/src/org/workcraft/plugins/son/ONGroup.java on lines 81..90
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 105..114
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 120..129
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 131..140
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 142..151

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

    @Override
    public VisualFunctionContact getFirstVisualOutput() {
        VisualFunctionContact result = null;
        for (VisualFunctionContact contact: getVisualFunctionContacts()) {
            if (contact.isOutput()) {
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/VisualCircuitComponent.java on lines 864..873
workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualFunctionComponent.java on lines 165..175

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

    public Collection<VisualTransitionEvent> getVisualTransitions() {
        HashSet<VisualTransitionEvent> result = new HashSet<>();
        for (Node node: getChildren()) {
            if (node instanceof VisualTransitionEvent) {
                result.add((VisualTransitionEvent) node);
workcraft/SonPlugin/src/org/workcraft/plugins/son/ONGroup.java on lines 70..79
workcraft/SonPlugin/src/org/workcraft/plugins/son/ONGroup.java on lines 81..90
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 105..114
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 120..129
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 131..140
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 142..151
workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/components/VisualXmasComponent.java on lines 126..134

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

    @Override
    public VisualFunctionContact getFirstVisualInput() {
        VisualFunctionContact result = null;
        for (VisualFunctionContact contact: getVisualFunctionContacts()) {
            if (contact.isInput()) {
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/VisualCircuitComponent.java on lines 864..873
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 Contact getFirstOutput() {
        Contact result = null;
        for (Contact contact: getContacts()) {
            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/VisualCircuitComponent.java on lines 853..862
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 8 locations. Consider refactoring.
Open

    public Collection<Event> getEvents() {
        ArrayList<Event> result = new ArrayList<>();
        for (Node node : getComponents()) {
            if (node instanceof Event) {
                result.add((Event) node);
Severity: Major
Found in workcraft/SonPlugin/src/org/workcraft/plugins/son/ONGroup.java and 7 other locations - About 35 mins to fix
workcraft/DtdPlugin/src/org/workcraft/plugins/dtd/VisualSignal.java on lines 238..246
workcraft/SonPlugin/src/org/workcraft/plugins/son/ONGroup.java on lines 70..79
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 105..114
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 120..129
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 131..140
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 142..151
workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/components/VisualXmasComponent.java on lines 126..134

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

    public Collection<Event> getEvents() {
        ArrayList<Event> result = new ArrayList<>();
        for (MathNode node : getComponents()) {
            if (node instanceof Event) {
                result.add((Event) node);
Severity: Major
Found in workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java and 7 other locations - About 35 mins to fix
workcraft/DtdPlugin/src/org/workcraft/plugins/dtd/VisualSignal.java on lines 238..246
workcraft/SonPlugin/src/org/workcraft/plugins/son/ONGroup.java on lines 70..79
workcraft/SonPlugin/src/org/workcraft/plugins/son/ONGroup.java on lines 81..90
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 105..114
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 131..140
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 142..151
workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/components/VisualXmasComponent.java on lines 126..134

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

    public Collection<Time> getTimeNodes() {
        ArrayList<Time> result = new ArrayList<>();
        for (MathNode node : getComponents()) {
            if (node instanceof Time) {
                result.add((Time) node);
Severity: Major
Found in workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java and 7 other locations - About 35 mins to fix
workcraft/DtdPlugin/src/org/workcraft/plugins/dtd/VisualSignal.java on lines 238..246
workcraft/SonPlugin/src/org/workcraft/plugins/son/ONGroup.java on lines 70..79
workcraft/SonPlugin/src/org/workcraft/plugins/son/ONGroup.java on lines 81..90
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 105..114
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 120..129
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 131..140
workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/components/VisualXmasComponent.java on lines 126..134

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 Contact getFirstInput() {
        Contact result = null;
        for (Contact contact: getContacts()) {
            if (contact.isInput()) {
                result = contact;
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/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 5 locations. Consider refactoring.
Open

package org.workcraft.exceptions;

public class FormatException extends RuntimeException {

    public FormatException() {
workcraft/WorkcraftCore/src/org/workcraft/exceptions/ArgumentException.java on lines 1..21
workcraft/WorkcraftCore/src/org/workcraft/exceptions/NodeCreationException.java on lines 1..21
workcraft/WorkcraftCore/src/org/workcraft/exceptions/SerialisationException.java on lines 1..21
workcraft/WorkcraftCore/src/org/workcraft/exceptions/VisualModelInstantiationException.java on lines 1..21

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

package org.workcraft.exceptions;

public class SerialisationException extends Exception {

    public SerialisationException() {
workcraft/WorkcraftCore/src/org/workcraft/exceptions/ArgumentException.java on lines 1..21
workcraft/WorkcraftCore/src/org/workcraft/exceptions/FormatException.java on lines 1..21
workcraft/WorkcraftCore/src/org/workcraft/exceptions/NodeCreationException.java on lines 1..21
workcraft/WorkcraftCore/src/org/workcraft/exceptions/VisualModelInstantiationException.java on lines 1..21

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

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

        @Override
        public Void run(Context cx) {
            Object scriptable = Context.javaToJS(args, systemScope);
            ScriptableObject.putProperty(systemScope, ARGS_VARIABLE, scriptable);
            systemScope.setAttributes(ARGS_VARIABLE, ScriptableObject.READONLY);
Severity: Minor
Found in workcraft/WorkcraftCore/src/org/workcraft/Framework.java and 1 other location - About 35 mins to fix
workcraft/WorkcraftCore/src/org/workcraft/Framework.java on lines 462..467

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

package org.workcraft.exceptions;

public class VisualModelInstantiationException extends java.lang.Exception {

    public VisualModelInstantiationException() {
workcraft/WorkcraftCore/src/org/workcraft/exceptions/ArgumentException.java on lines 1..21
workcraft/WorkcraftCore/src/org/workcraft/exceptions/FormatException.java on lines 1..21
workcraft/WorkcraftCore/src/org/workcraft/exceptions/NodeCreationException.java on lines 1..21
workcraft/WorkcraftCore/src/org/workcraft/exceptions/SerialisationException.java on lines 1..21

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

Severity
Category
Status
Source
Language