workcraft/workcraft

View on GitHub
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java

Summary

Maintainability
C
1 day
Test Coverage

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

    private Transition getExcitedTransitionOfCollection(List<VisualSignalTransition> ts) {
        if (ts != null) {
            for (VisualSignalTransition t: ts) {
                if (t == null) continue;
                Transition transition = t.getReferencedComponent();
workcraft/PolicyPlugin/src/org/workcraft/plugins/policy/tools/PolicySimulationTool.java on lines 168..179
workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasSimulationTool.java on lines 319..330

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

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

                if (deepestNode instanceof VisualCounterflowLogic) {
                    CounterflowLogicStg nodeStg = converter.getCounterflowLogicStg((VisualCounterflowLogic) deepestNode);
                    if (nodespacePosition.getY() < 0) {
                        transition = getExcitedTransitionOfCollection(nodeStg.getForwardTransitions());
                    } else {
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 193..200
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 186..193
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 179..186
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 172..179

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 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 5 locations. Consider refactoring.
Open

                } else if (deepestNode instanceof VisualCounterflowRegister) {
                    CounterflowRegisterStg nodeStg = converter.getCounterflowRegisterStg((VisualCounterflowRegister) deepestNode);
                    if (nodespacePosition.getY() < 0) {
                        transition = getExcitedTransitionOfCollection(nodeStg.getOrTransitions());
                    } else {
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 193..200
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 186..193
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 179..186
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 165..172

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

                } else if (deepestNode instanceof VisualPopRegister) {
                    BinaryRegisterStg nodeStg = converter.getPopRegisterStg((VisualPopRegister) deepestNode);
                    if (nodespacePosition.getY() < 0) {
                        transition = getExcitedTransitionOfCollection(nodeStg.getTrueTransitions());
                    } else {
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 186..193
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 179..186
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 172..179
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 165..172

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

                } else if (deepestNode instanceof VisualPushRegister) {
                    BinaryRegisterStg nodeStg = converter.getPushRegisterStg((VisualPushRegister) deepestNode);
                    if (nodespacePosition.getY() < 0) {
                        transition = getExcitedTransitionOfCollection(nodeStg.getTrueTransitions());
                    } else {
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 193..200
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 179..186
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 172..179
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 165..172

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

                } else if (deepestNode instanceof VisualControlRegister) {
                    BinaryRegisterStg nodeStg = converter.getControlRegisterStg((VisualControlRegister) deepestNode);
                    if (nodespacePosition.getY() < 0) {
                        transition = getExcitedTransitionOfCollection(nodeStg.getTrueTransitions());
                    } else {
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 193..200
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 186..193
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 172..179
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 165..172

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

            if ((falseM1Node instanceof Place) && savedState.containsKey(falseM1Node)) {
                if (savedState.get(falseM1Node) > 0) {
                    node.getReferencedComponent().setMarking(Marking.FALSE_TOKEN);
                }
                copyTokenColor(node, falseM1Node);
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 138..143

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

            if ((m1Node instanceof Place) && savedState.containsKey(m1Node)) {
                boolean marked = savedState.get(m1Node) > 0;
                node.getReferencedComponent().setMarked(marked);
                copyTokenColor(node, m1Node);
            }
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 117..121
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 124..128

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

            if ((trueM1Node instanceof Place) && savedState.containsKey(trueM1Node)) {
                if (savedState.get(trueM1Node) > 0) {
                    node.getReferencedComponent().setMarking(Marking.TRUE_TOKEN);
                }
                copyTokenColor(node, trueM1Node);
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 146..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 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 3 locations. Consider refactoring.
Open

            if ((andM1Node instanceof Place) && savedState.containsKey(andM1Node)) {
                boolean andMarked = savedState.get(andM1Node) > 0;
                node.getReferencedComponent().setAndMarked(andMarked);
                copyTokenColor(node, andM1Node);
            }
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 94..98
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 117..121

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

            if ((orM1Node instanceof Place) && savedState.containsKey(orM1Node)) {
                boolean orMarked = savedState.get(orM1Node) > 0;
                node.getReferencedComponent().setOrMarked(orMarked);
                copyTokenColor(node, orM1Node);
            }
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 94..98
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 124..128

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

            if ((bwC1Node instanceof Place) && savedState.containsKey(bwC1Node)) {
                boolean backwardComputed = savedState.get(bwC1Node) > 0;
                node.getReferencedComponent().setBackwardComputed(backwardComputed);
            }
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 86..89
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 103..106

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

            if ((c1Node instanceof Place) && savedState.containsKey(c1Node)) {
                boolean computed = savedState.get(c1Node) > 0;
                node.getReferencedComponent().setComputed(computed);
            }
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 103..106
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 109..112

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

            if ((fwC1Node instanceof Place) && savedState.containsKey(fwC1Node)) {
                boolean forwardComputed = savedState.get(fwC1Node) > 0;
                node.getReferencedComponent().setForwardComputed(forwardComputed);
            }
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 86..89
workcraft/DfsPlugin/src/org/workcraft/plugins/dfs/tools/DfsSimulationTool.java on lines 109..112

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

There are no issues that match your filters.

Category
Status