workcraft/workcraft

View on GitHub
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java

Summary

Maintainability
C
1 day
Test Coverage

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

    public void setForegroundColor(Node n, Color nodeColor) {
        if (n instanceof PlaceNode) {
            ((PlaceNode) n).setForegroundColor(nodeColor);
        }
        if (n instanceof TransitionNode) {
Severity: Major
Found in workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java and 1 other location - About 1 hr to fix
workcraft/SonPlugin/src/org/workcraft/plugins/son/VisualSON.java on lines 599..612

Duplicated Code

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

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

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

Tuning

This issue has a mass of 85.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    public Collection<SONConnection> getOutputScenarioPNConnections(MathNode node, ScenarioRef s) {
        Collection<SONConnection> result = new ArrayList<>();

        for (SONConnection con : getOutputSONConnections(node)) {
            if (con.getSemantics() == Semantics.PNLINE) {
Severity: Major
Found in workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java and 1 other location - About 1 hr to fix
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 453..468

Duplicated Code

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

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

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

Tuning

This issue has a mass of 85.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    public Collection<SONConnection> getInputScenarioPNConnections(MathNode node, ScenarioRef s) {
        Collection<SONConnection> result = new ArrayList<>();

        for (SONConnection con : getInputSONConnections(node)) {
            if (con.getSemantics() == Semantics.PNLINE) {
Severity: Major
Found in workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java and 1 other location - About 1 hr to fix
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 470..485

Duplicated Code

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

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

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

Tuning

This issue has a mass of 85.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    public final Condition createCondition(String name, Container container) {
        if (container == null) {
            container = getRoot();
        }
        Condition condition = new Condition();
Severity: Major
Found in workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java and 2 other locations - About 50 mins to fix
workcraft/PetriPlugin/src/org/workcraft/plugins/petri/Petri.java on lines 27..37
workcraft/PetriPlugin/src/org/workcraft/plugins/petri/Petri.java on lines 39..49

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    public Collection<Semantics> getOutputSONConnectionTypes(MathNode node) {
        Collection<Semantics> result = new HashSet<>();
        for (SONConnection con : this.getSONConnections(node)) {
            if (con.getFirst() == node) {
                result.add(con.getSemantics());
Severity: Minor
Found in workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java and 1 other location - About 40 mins to fix
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 411..419

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

    public Collection<Semantics> getInputSONConnectionTypes(MathNode node) {
        Collection<Semantics> result = new HashSet<>();
        for (SONConnection con : this.getSONConnections(node)) {
            if (con.getSecond() == node) {
                result.add(con.getSemantics());
Severity: Minor
Found in workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java and 1 other location - About 40 mins to fix
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 421..429

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

    public Collection<SONConnection> getOutputPNConnections(MathNode node) {
        Collection<SONConnection> result = new ArrayList<>();

        for (SONConnection con : getOutputSONConnections(node)) {
            if (con.getSemantics() == Semantics.PNLINE) {
Severity: Minor
Found in workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java and 1 other location - About 40 mins to fix
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 431..440

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    public Collection<SONConnection> getOutputSONConnections(MathNode node) {
        Collection<SONConnection> result = new ArrayList<>();
        for (SONConnection con : this.getSONConnections(node)) {
            if (con.getFirst() == node) {
                result.add(con);
Severity: Minor
Found in workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java and 1 other location - About 40 mins to fix
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 365..373

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    public Collection<SONConnection> getInputPNConnections(MathNode node) {
        Collection<SONConnection> result = new ArrayList<>();

        for (SONConnection con : getInputSONConnections(node)) {
            if (con.getSemantics() == Semantics.PNLINE) {
Severity: Minor
Found in workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java and 1 other location - About 40 mins to fix
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 442..451

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    public Collection<SONConnection> getInputSONConnections(MathNode node) {
        ArrayList<SONConnection> result = new ArrayList<>();
        for (SONConnection con : this.getSONConnections(node)) {
            if (con.getSecond() == node) {
                result.add(con);
Severity: Minor
Found in workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java and 1 other location - About 40 mins to fix
workcraft/SonPlugin/src/org/workcraft/plugins/son/SON.java on lines 375..383

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

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

There are no issues that match your filters.

Category
Status