workcraft/workcraft

View on GitHub

Showing 1,895 of 2,484 total issues

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

    public Collection<Block> getCollapsedBlocks() {
        Collection<Block> result = new ArrayList<>();
        for (Block block : getBlocks()) {
            if (block.getIsCollapsed()) {
                result.add(block);
Severity: Major
Found in workcraft/SonPlugin/src/org/workcraft/plugins/son/ONGroup.java and 6 other locations - About 30 mins to fix
workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/CircuitComponent.java on lines 70..78
workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/CircuitComponent.java on lines 80..88
workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/FunctionComponent.java on lines 82..90
workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/FunctionComponent.java on lines 92..100
workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 833..841
workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 843..851

Duplicated Code

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

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

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

Tuning

This issue has a mass of 41.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 41.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 41.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 41.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 41.

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

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

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

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

Refactorings

Further Reading

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

    private Trace readSteps(Element parent) {
        Trace result = new Trace();
        for (Element element : XmlUtils.getChildElements(STEP_ELEMENT, parent)) {
            result.add(element.getAttribute(TRANSITION_ATTRIBUTE));
        }
workcraft/MpsatVerificationPlugin/src/org/workcraft/plugins/mpsat_verification/presets/HandshakeDataSerialiser.java on lines 48..54

Duplicated Code

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

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

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

Tuning

This issue has a mass of 41.

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

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

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

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

Refactorings

Further Reading

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

    public Collection<FunctionContact> getFunctionInputs() {
        ArrayList<FunctionContact> result = new ArrayList<>();
        for (FunctionContact contact: getFunctionContacts()) {
            if (contact.isInput()) {
                result.add(contact);
workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/CircuitComponent.java on lines 70..78
workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/CircuitComponent.java on lines 80..88
workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/FunctionComponent.java on lines 92..100
workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 833..841
workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 843..851
workcraft/SonPlugin/src/org/workcraft/plugins/son/ONGroup.java on lines 116..124

Duplicated Code

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

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

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

Tuning

This issue has a mass of 41.

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

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

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

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

Refactorings

Further Reading

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

    public Collection<Contact> getInputs() {
        ArrayList<Contact> result = new ArrayList<>();
        for (Contact contact: getContacts()) {
            if (contact.isInput()) {
                result.add(contact);
workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/CircuitComponent.java on lines 80..88
workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/FunctionComponent.java on lines 82..90
workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/FunctionComponent.java on lines 92..100
workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 833..841
workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java on lines 843..851
workcraft/SonPlugin/src/org/workcraft/plugins/son/ONGroup.java on lines 116..124

Duplicated Code

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

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

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

Tuning

This issue has a mass of 41.

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

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

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

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

Refactorings

Further Reading

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

package org.workcraft.plugins.builtin.interop;

import org.apache.fop.render.ps.EPSTranscoder;
import org.workcraft.dom.Model;
import org.workcraft.dom.visual.VisualModel;
workcraft/WorkcraftCore/src/org/workcraft/plugins/builtin/interop/PdfExporter.java on lines 1..29
workcraft/WorkcraftCore/src/org/workcraft/plugins/builtin/interop/PsExporter.java on lines 1..29

Duplicated Code

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

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

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

Tuning

This issue has a mass of 41.

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

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

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

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

Refactorings

Further Reading

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

package org.workcraft.plugins.builtin.interop;

import org.apache.fop.render.ps.PSTranscoder;
import org.workcraft.dom.Model;
import org.workcraft.dom.visual.VisualModel;
workcraft/WorkcraftCore/src/org/workcraft/plugins/builtin/interop/EpsExporter.java on lines 1..29
workcraft/WorkcraftCore/src/org/workcraft/plugins/builtin/interop/PdfExporter.java on lines 1..29

Duplicated Code

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

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

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

Tuning

This issue has a mass of 41.

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

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

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

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

Refactorings

Further Reading

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

    @Test
    void testDevConformationVerification() throws DeserialisationException {
        String workName = PackageUtils.getPackagePath(getClass(), "dev.stg.work");
        String envName = PackageUtils.getPackagePath(getClass(), "env.stg.work");
        testConformationVerificationCommands(workName, envName, true);
workcraft/MpsatVerificationPlugin/test-src/org/workcraft/plugins/mpsat_verification/ConformationVerificationCommandTests.java on lines 34..39
workcraft/MpsatVerificationPlugin/test-src/org/workcraft/plugins/mpsat_verification/ConformationVerificationCommandTests.java on lines 48..53

Duplicated Code

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

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

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

Tuning

This issue has a mass of 41.

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

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

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

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

Refactorings

Further Reading

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

    @Test
    void testCycleConformationVerification() throws DeserialisationException {
        String workName = PackageUtils.getPackagePath(getClass(), "cycle-mutex.stg.work");
        String envName = PackageUtils.getPackagePath(getClass(), "charge.stg.work");
        testConformationVerificationCommands(workName, envName, true);
workcraft/MpsatVerificationPlugin/test-src/org/workcraft/plugins/mpsat_verification/ConformationVerificationCommandTests.java on lines 41..46
workcraft/MpsatVerificationPlugin/test-src/org/workcraft/plugins/mpsat_verification/ConformationVerificationCommandTests.java on lines 48..53

Duplicated Code

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

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

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

Tuning

This issue has a mass of 41.

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

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

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

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

Refactorings

Further Reading

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

    private Collection<String> readSignals(Element parent, String elementName) {
        Collection<String> result = new HashSet<>();
        for (Element element : XmlUtils.getChildElements(elementName, parent)) {
            result.add(element.getAttribute(SETTINGS_NAME_ATTRIBUTE));
        }
workcraft/MpsatVerificationPlugin/src/org/workcraft/plugins/mpsat_verification/tasks/SolutionReader.java on lines 77..83

Duplicated Code

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

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

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

Tuning

This issue has a mass of 41.

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

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

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

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

Refactorings

Further Reading

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

    @Test
    void testDevBadConformationVerification() throws DeserialisationException {
        String workName = PackageUtils.getPackagePath(getClass(), "dev-bad.stg.work");
        String envName = PackageUtils.getPackagePath(getClass(), "env.stg.work");
        testConformationVerificationCommands(workName, envName, false);
workcraft/MpsatVerificationPlugin/test-src/org/workcraft/plugins/mpsat_verification/ConformationVerificationCommandTests.java on lines 34..39
workcraft/MpsatVerificationPlugin/test-src/org/workcraft/plugins/mpsat_verification/ConformationVerificationCommandTests.java on lines 41..46

Duplicated Code

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

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

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

Tuning

This issue has a mass of 41.

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

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

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

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

Refactorings

Further Reading

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

package org.workcraft.plugins.builtin.interop;

import org.apache.fop.svg.PDFTranscoder;
import org.workcraft.dom.Model;
import org.workcraft.dom.visual.VisualModel;
workcraft/WorkcraftCore/src/org/workcraft/plugins/builtin/interop/EpsExporter.java on lines 1..29
workcraft/WorkcraftCore/src/org/workcraft/plugins/builtin/interop/PsExporter.java on lines 1..29

Duplicated Code

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

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

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

Tuning

This issue has a mass of 41.

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

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

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

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

Refactorings

Further Reading

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

    private void removeObservedNode(TransformObserver to, Node node) {
        LinkedList<Node> list = observerToNodes.get(to);
        list.remove(node);

        if (list.isEmpty()) {
workcraft/WorkcraftCore/src/org/workcraft/dom/visual/TransformEventPropagator.java on lines 32..38

Duplicated Code

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

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

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

Tuning

This issue has a mass of 41.

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

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

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

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

Refactorings

Further Reading

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

    private void removeObserver(Node node, TransformObserver to) {
        LinkedList<TransformObserver> list = nodeToObservers.get(node);
        list.remove(to);
        if (list.isEmpty()) {
            nodeToObservers.remove(node);
workcraft/WorkcraftCore/src/org/workcraft/dom/visual/TransformEventPropagator.java on lines 49..56

Duplicated Code

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

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

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

Tuning

This issue has a mass of 41.

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

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

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

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

Refactorings

Further Reading

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

    private JPanel createTextPanel() {
        codePanel = new CodePanel(11);
        JPanel panel = new JPanel(GuiUtils.createBorderLayout());
        panel.add(codePanel, BorderLayout.CENTER);
        return panel;
workcraft/CfltPlugin/src/org/workcraft/plugins/cflt/gui/ExpressionDialog.java on lines 116..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 41.

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

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

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

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

Refactorings

Further Reading

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

    public JPanel createExpressionPanel() {
        codePanel = new CodePanel(11);
        JPanel result = new JPanel(GuiUtils.createBorderLayout());
        result.add(codePanel, BorderLayout.CENTER);
        return result;
workcraft/WorkcraftCore/src/org/workcraft/presets/TextPresetDialog.java on lines 48..53

Duplicated Code

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

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

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

Tuning

This issue has a mass of 41.

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

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

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

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

Refactorings

Further Reading

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

    public CoordinateOrientation getHorizontalOrientation() {
        if (this == WEST) {
            return CoordinateOrientation.ORIENT_LOWER;
        }

workcraft/CircuitPlugin/src/org/workcraft/plugins/circuit/routing/basic/PortDirection.java on lines 82..92

Duplicated Code

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

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

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

Tuning

This issue has a mass of 41.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language