SiLeBAT/FSK-Lab

View on GitHub
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java

Summary

Maintainability
C
1 day
Test Coverage

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

    @Test
    public void testInitializeModel_otherModel_shouldReturnOtherModel() {
        Model model = NodeUtils.initializeModel(ModelType.otherModel);
        assertThat(model, instanceOf(OtherModel.class));
        assertEquals("otherModel", model.getModelType());
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 33..43
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 57..67
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 69..79
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 81..91
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 93..103
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 117..127
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 129..139
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 141..151
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 153..163
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.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 75.

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

    @Test
    public void testInitializeModel_predictiveModel_shouldReturnPredictiveModel() {
        Model model = NodeUtils.initializeModel(ModelType.predictiveModel);
        assertThat(model, instanceOf(PredictiveModel.class));
        assertEquals("predictiveModel", model.getModelType());
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 33..43
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 57..67
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 69..79
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 81..91
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 93..103
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 105..115
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 129..139
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 141..151
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 153..163
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.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 75.

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

    @Test
    public void testInitializeModel_doseResponseModel_shouldReturnDoseResponseModel() {
        Model model = NodeUtils.initializeModel(ModelType.doseResponseModel);
        assertThat(model, instanceOf(DoseResponseModel.class));
        assertEquals("doseResponseModel", model.getModelType());
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 33..43
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 57..67
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 81..91
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 93..103
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 105..115
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 117..127
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 129..139
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 141..151
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 153..163
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.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 75.

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

    @Test
    public void testInitializeModel_exposureModel_shouldReturnExposureModel() {
        Model model = NodeUtils.initializeModel(ModelType.exposureModel);
        assertThat(model, instanceOf(ExposureModel.class));
        assertEquals("exposureModel", model.getModelType());
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 33..43
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 57..67
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 69..79
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 93..103
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 105..115
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 117..127
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 129..139
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 141..151
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 153..163
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.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 75.

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

    @Test
    public void testInitializeModel_healthModel_shouldReturnHealthModel() {
        Model model = NodeUtils.initializeModel(ModelType.healthModel);
        assertThat(model, instanceOf(HealthModel.class));
        assertEquals("healthModel", model.getModelType());
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 33..43
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 57..67
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 69..79
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 81..91
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 105..115
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 117..127
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 129..139
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 141..151
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 153..163
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.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 75.

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

    @Test
    public void testInitializeModel_genericModel_shouldReturnGenericModel() {
        Model model = NodeUtils.initializeModel(ModelType.genericModel);
        assertThat(model, instanceOf(GenericModel.class));
        assertEquals("genericModel", model.getModelType());
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 57..67
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 69..79
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 81..91
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 93..103
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 105..115
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 117..127
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 129..139
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 141..151
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 153..163
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.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 75.

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

    @Test
    public void testInitializeModel_riskModel_shouldReturnRiskModel() {
        Model model = NodeUtils.initializeModel(ModelType.riskModel);
        assertThat(model, instanceOf(RiskModel.class));
        assertEquals("riskModel", model.getModelType());
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 33..43
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 57..67
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 69..79
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 81..91
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 93..103
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 105..115
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 117..127
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 129..139
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 141..151
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.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 75.

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

    @Test
    public void testInitializeModel_toxicologicalModel_shouldReturnToxicologicalModel() {
        Model model = NodeUtils.initializeModel(ModelType.toxicologicalModel);
        assertThat(model, instanceOf(ToxicologicalModel.class));
        assertEquals("toxicologicalModel", model.getModelType());
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 33..43
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 57..67
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 69..79
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 81..91
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 93..103
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 105..115
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 117..127
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 129..139
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 141..151
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 153..163

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

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

    @Test
    public void testInitializeModel_consumptionModel_shouldReturnConsumptionModel() {
        Model model = NodeUtils.initializeModel(ModelType.consumptionModel);
        assertThat(model, instanceOf(ConsumptionModel.class));
        assertEquals("consumptionModel", model.getModelType());
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 33..43
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 69..79
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 81..91
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 93..103
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 105..115
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 117..127
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 129..139
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 141..151
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 153..163
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.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 75.

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

    @Test
    public void testInitializeModel_qraModel_shouldReturnQraModel() {
        Model model = NodeUtils.initializeModel(ModelType.qraModel);
        assertThat(model, instanceOf(QraModel.class));
        assertEquals("qraModel", model.getModelType());
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 33..43
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 57..67
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 69..79
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 81..91
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 93..103
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 105..115
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 117..127
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 129..139
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 153..163
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.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 75.

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

    @Test
    public void testInitializeModel_processModel_shouldReturnProcessModel() {
        Model model = NodeUtils.initializeModel(ModelType.processModel);
        assertThat(model, instanceOf(ProcessModel.class));
        assertEquals("processModel", model.getModelType());
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 33..43
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 57..67
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 69..79
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 81..91
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 93..103
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 105..115
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 117..127
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 141..151
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.java on lines 153..163
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/NodeUtilsTest.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 75.

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