SiLeBAT/FSK-Lab

View on GitHub
de.bund.bfr.knime.pmm.common/src/de/bund/bfr/knime/pmm/common/PmmTimeSeries.java

Summary

Maintainability
F
6 days
Test Coverage

PmmTimeSeries has 61 methods (exceeds 20 allowed). Consider refactoring.
Open

public class PmmTimeSeries extends KnimeTuple implements PmmXmlElementConvertable {
    
    public static final String ELEMENT_TIMESERIES = "TimeSeries";
    //private static final String ELEMENT_TSTUPLE = "TimeSeriesTuple";
    private static final String ELEMENT_TSXML = "TimeSeriesXml";

File PmmTimeSeries.java has 479 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*******************************************************************************
 * Copyright (c) 2015 Federal Institute for Risk Assessment (BfR), Germany
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by

Method addMiscs has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    public void addMiscs(final PmmXmlDoc misc) throws PmmException {
        PmmXmlDoc miscXmlDoc = getMisc();
        if (miscXmlDoc == null) {
            setValue(TimeSeriesSchema.ATT_MISC, misc);            
        }

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method setMatrixAttribute has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    private void setMatrixAttribute(Integer id, String name, String detail, String dbuuid) throws PmmException {
        PmmXmlDoc matrixXmlDoc = getMatrix();
        if (matrixXmlDoc == null) matrixXmlDoc = new PmmXmlDoc();
        MatrixXml mx = null;
        for (PmmXmlElementConvertable el : matrixXmlDoc.getElementSet()) {

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method setAgentAttribute has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    private void setAgentAttribute(Integer id, String name, String detail, String dbuuid) throws PmmException {
        PmmXmlDoc agentXmlDoc = getAgent();
        if (agentXmlDoc == null) agentXmlDoc = new PmmXmlDoc();
        AgentXml ax = null;
        for (PmmXmlElementConvertable el : agentXmlDoc.getElementSet()) {

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method getAgentAttribute has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    private Object getAgentAttribute(boolean id, boolean name, boolean detail) throws PmmException {
        PmmXmlDoc agentXmlDoc = getAgent();
        if (agentXmlDoc == null) agentXmlDoc = new PmmXmlDoc();
        AgentXml ax = null;
        for (PmmXmlElementConvertable el : agentXmlDoc.getElementSet()) {

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method getMatrixAttribute has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    private Object getMatrixAttribute(boolean id, boolean name, boolean detail) throws PmmException {
        PmmXmlDoc matrixXmlDoc = getMatrix();
        if (matrixXmlDoc == null) matrixXmlDoc = new PmmXmlDoc();
        MatrixXml mx = null;
        for (PmmXmlElementConvertable el : matrixXmlDoc.getElementSet()) {

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method toXmlElement has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Override
    public Element toXmlElement() {        
        Element ret = new Element(ELEMENT_TIMESERIES);        
        try {        
            if (getCondId() != null) {

Method getMiscUnit has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private String getMiscUnit(String attribute, String defaultValue) throws PmmException {
        PmmXmlDoc miscXmlDoc = getMisc();
        if (miscXmlDoc != null) {
            MiscXml mx = null;
            for (PmmXmlElementConvertable el : miscXmlDoc.getElementSet()) {

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method hasValue has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean hasValue(String attribute, boolean defaultValue) throws PmmException {
        PmmXmlDoc miscXmlDoc = getMisc();
        if (miscXmlDoc != null) {
            MiscXml mx = null;
            for (PmmXmlElementConvertable el : miscXmlDoc.getElementSet()) {

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method addMisc has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public void addMisc(int attrID, String attribute, String description, Double value, List<String> categories, String unit) throws PmmException {
        PmmXmlDoc miscXmlDoc = getMisc();
        if (miscXmlDoc == null) miscXmlDoc = new PmmXmlDoc();
        MiscXml mx = null;
        boolean paramFound = false;

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method getMiscValue has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public Double getMiscValue(String attribute, Double defaultValue) throws PmmException {
        PmmXmlDoc miscXmlDoc = getMisc();
        if (miscXmlDoc != null) {
            MiscXml mx = null;
            for (PmmXmlElementConvertable el : miscXmlDoc.getElementSet()) {

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method addMisc has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public void addMisc(int attrID, String attribute, String description, Double value, List<String> categories, String unit) throws PmmException {

Method toXmlElement has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public Element toXmlElement() {        
        Element ret = new Element(ELEMENT_TIMESERIES);        
        try {        
            if (getCondId() != null) {

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Avoid deeply nested control flow statements.
Open

                            if (mx.name.equalsIgnoreCase(mx2Add.name)) {
                                paramFound = true;
                                break;
                            }

Method add has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public void add(String name, Double t, String tUnit, Double n, String nUnit) throws PmmException {        

Method getChecked has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public Boolean getChecked() throws PmmException {
        PmmXmlDoc mdInfoXmlDoc = getMdInfo();
        if (mdInfoXmlDoc != null) {
            MdInfoXml mdix = null;
            for (PmmXmlElementConvertable el : mdInfoXmlDoc.getElementSet()) {

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method getQualityScore has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public Integer getQualityScore() throws PmmException {
        PmmXmlDoc mdInfoXmlDoc = getMdInfo();
        if (mdInfoXmlDoc != null) {
            MdInfoXml mdix = null;
            for (PmmXmlElementConvertable el : mdInfoXmlDoc.getElementSet()) {

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method getComment has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public String getComment() throws PmmException {
        PmmXmlDoc mdInfoXmlDoc = getMdInfo();
        if (mdInfoXmlDoc != null) {
            MdInfoXml mdix = null;
            for (PmmXmlElementConvertable el : mdInfoXmlDoc.getElementSet()) {

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

    private void setMatrixAttribute(Integer id, String name, String detail, String dbuuid) throws PmmException {

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

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

    public PmmTimeSeries(Element xmlElement) {

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

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

    private void setAgentAttribute(Integer id, String name, String detail, String dbuuid) throws PmmException {

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

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

    public void addMiscs(final PmmXmlDoc misc) throws PmmException {

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

Null is returned but a "Boolean" is expected.
Open

        return null;//getString( TimeSeriesSchema.ATT_COMMENT );

While null is technically a valid Boolean value, that fact, and the distinction between Boolean and boolean is easy to forget. So returning null from a Boolean method is likely to cause problems with callers' code.

Noncompliant Code Example

public Boolean isUsable() {
  // ...
  return null;  // Noncompliant
}

See

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

    private void setMatrixAttribute(Integer id, String name, String detail, String dbuuid) throws PmmException {
        PmmXmlDoc matrixXmlDoc = getMatrix();
        if (matrixXmlDoc == null) matrixXmlDoc = new PmmXmlDoc();
        MatrixXml mx = null;
        for (PmmXmlElementConvertable el : matrixXmlDoc.getElementSet()) {
de.bund.bfr.knime.pmm.common/src/de/bund/bfr/knime/pmm/common/PmmTimeSeries.java on lines 456..474

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

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 setAgentAttribute(Integer id, String name, String detail, String dbuuid) throws PmmException {
        PmmXmlDoc agentXmlDoc = getAgent();
        if (agentXmlDoc == null) agentXmlDoc = new PmmXmlDoc();
        AgentXml ax = null;
        for (PmmXmlElementConvertable el : agentXmlDoc.getElementSet()) {
de.bund.bfr.knime.pmm.common/src/de/bund/bfr/knime/pmm/common/PmmTimeSeries.java on lines 475..493

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

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 Object getAgentAttribute(boolean id, boolean name, boolean detail) throws PmmException {
        PmmXmlDoc agentXmlDoc = getAgent();
        if (agentXmlDoc == null) agentXmlDoc = new PmmXmlDoc();
        AgentXml ax = null;
        for (PmmXmlElementConvertable el : agentXmlDoc.getElementSet()) {
de.bund.bfr.knime.pmm.common/src/de/bund/bfr/knime/pmm/common/PmmTimeSeries.java on lines 199..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 104.

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 Object getMatrixAttribute(boolean id, boolean name, boolean detail) throws PmmException {
        PmmXmlDoc matrixXmlDoc = getMatrix();
        if (matrixXmlDoc == null) matrixXmlDoc = new PmmXmlDoc();
        MatrixXml mx = null;
        for (PmmXmlElementConvertable el : matrixXmlDoc.getElementSet()) {
de.bund.bfr.knime.pmm.common/src/de/bund/bfr/knime/pmm/common/PmmTimeSeries.java on lines 214..228

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

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 Double getMiscValue(String attribute, Double defaultValue) throws PmmException {
        PmmXmlDoc miscXmlDoc = getMisc();
        if (miscXmlDoc != null) {
            MiscXml mx = null;
            for (PmmXmlElementConvertable el : miscXmlDoc.getElementSet()) {
de.bund.bfr.knime.pmm.common/src/de/bund/bfr/knime/pmm/common/PmmTimeSeries.java on lines 244..258

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

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 String getMiscUnit(String attribute, String defaultValue) throws PmmException {
        PmmXmlDoc miscXmlDoc = getMisc();
        if (miscXmlDoc != null) {
            MiscXml mx = null;
            for (PmmXmlElementConvertable el : miscXmlDoc.getElementSet()) {
de.bund.bfr.knime.pmm.common/src/de/bund/bfr/knime/pmm/common/PmmTimeSeries.java on lines 229..243

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

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 Boolean getChecked() throws PmmException {
        PmmXmlDoc mdInfoXmlDoc = getMdInfo();
        if (mdInfoXmlDoc != null) {
            MdInfoXml mdix = null;
            for (PmmXmlElementConvertable el : mdInfoXmlDoc.getElementSet()) {
de.bund.bfr.knime.pmm.common/src/de/bund/bfr/knime/pmm/common/PmmTimeSeries.java on lines 324..336
de.bund.bfr.knime.pmm.common/src/de/bund/bfr/knime/pmm/common/PmmTimeSeries.java on lines 337..349

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

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 String getComment() throws PmmException {
        PmmXmlDoc mdInfoXmlDoc = getMdInfo();
        if (mdInfoXmlDoc != null) {
            MdInfoXml mdix = null;
            for (PmmXmlElementConvertable el : mdInfoXmlDoc.getElementSet()) {
de.bund.bfr.knime.pmm.common/src/de/bund/bfr/knime/pmm/common/PmmTimeSeries.java on lines 337..349
de.bund.bfr.knime.pmm.common/src/de/bund/bfr/knime/pmm/common/PmmTimeSeries.java on lines 350..362

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

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 Integer getQualityScore() throws PmmException {
        PmmXmlDoc mdInfoXmlDoc = getMdInfo();
        if (mdInfoXmlDoc != null) {
            MdInfoXml mdix = null;
            for (PmmXmlElementConvertable el : mdInfoXmlDoc.getElementSet()) {
de.bund.bfr.knime.pmm.common/src/de/bund/bfr/knime/pmm/common/PmmTimeSeries.java on lines 324..336
de.bund.bfr.knime.pmm.common/src/de/bund/bfr/knime/pmm/common/PmmTimeSeries.java on lines 350..362

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

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 PmmXmlDoc getTimeSeries() {
        PmmXmlDoc timeSeriesXmlDoc = null;
        try {
            timeSeriesXmlDoc = this.getPmmXml(TimeSeriesSchema.ATT_TIMESERIES);
        }
de.bund.bfr.knime.pmm.common/src/de/bund/bfr/knime/pmm/common/PmmTimeSeries.java on lines 287..296

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

    public PmmXmlDoc getMdInfo() {
        PmmXmlDoc mdInfoXmlDoc = null;
        try {
            mdInfoXmlDoc = this.getPmmXml(TimeSeriesSchema.ATT_MDINFO);
        }
de.bund.bfr.knime.pmm.common/src/de/bund/bfr/knime/pmm/common/PmmTimeSeries.java on lines 297..306

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