SiLeBAT/FSK-Lab

View on GitHub
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/common/reader/Model1Tuple.java

Summary

Maintainability
C
7 hrs
Test Coverage

Refactor this method to reduce its Cognitive Complexity from 44 to the 15 allowed.
Open

    public Model1Tuple(SBMLDocument doc) {

Cognitive Complexity is a measure of how hard the control flow of a method is to understand. Methods with high Cognitive Complexity will be difficult to maintain.

See

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

        for (Reference ref : rule.getReferences()) {
            String author = ref.getAuthor();
            Integer year = ref.getYear();
            String title = ref.getTitle();
            String abstractText = ref.getAbstractText();
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/common/reader/Model2Tuple.java on lines 120..142
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/common/reader/Model2Tuple.java on lines 146..168

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

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

            } else {
                String depUnitName = model.getUnitDefinition(depUnitID).getName();
                depXml.unit = depUnitName;
                if (DBUnits.getDBUnits().containsKey(depUnitName)) {
                    depXml.category = DBUnits.getDBUnits().get(depUnitName).kindOfPropertyQuantity;
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/common/reader/Model1Tuple.java on lines 112..118

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

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

            if (!unitID.equals(Unit.Kind.DIMENSIONLESS.getName())) {
                String unitName = model.getUnitDefinition(unitID).getName();
                paramXml.unit = unitName;
                if (DBUnits.getDBUnits().containsKey(unitName)) {
                    paramXml.category = DBUnits.getDBUnits().get(unitName).kindOfPropertyQuantity;
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/common/reader/Model1Tuple.java on lines 66..72

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

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

        if (limits.containsKey(indepParam.getId())) {
            Limits indepLimits = limits.get(indepParam.getId());
            indepXml.max = indepLimits.getMax();
            indepXml.min = indepLimits.getMin();
        }
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/common/reader/Model1Tuple.java on lines 79..83
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/common/reader/Model1Tuple.java on lines 139..143
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/common/reader/Model2Tuple.java on lines 209..213

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

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

        if (limits.containsKey(species.getId())) {
            Limits depLimits = limits.get(species.getId());
            depXml.max = depLimits.getMax();
            depXml.min = depLimits.getMin();
        }
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/common/reader/Model1Tuple.java on lines 97..101
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/common/reader/Model1Tuple.java on lines 139..143
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/common/reader/Model2Tuple.java on lines 209..213

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

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

            if (limits.containsKey(param.getId())) {
                Limits constLimits = limits.get(param.getId());
                paramXml.max = constLimits.getMax();
                paramXml.min = constLimits.getMin();
            }
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/common/reader/Model1Tuple.java on lines 79..83
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/common/reader/Model1Tuple.java on lines 97..101
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/common/reader/Model2Tuple.java on lines 209..213

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

There are no issues that match your filters.

Category
Status