SiLeBAT/FSK-Lab

View on GitHub
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java

Summary

Maintainability
F
3 days
Test Coverage

File XLS2PCMLNodeModel.java has 369 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 fetchConditions has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    private List<ConditionsData> fetchConditions(BufferedDataTable table) {

        /**
         * Two types of conditions tables:
         * <ol>

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 createDataTable has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    private DataTable createDataTable(ExpColumnList colList, List<DataPoint> dataPoints) {
        DataTable table = DataTable.Factory.newInstance();
        
        table.setColumnList(colList.columnList);

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 createPcData has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    private void createPcData(PCMLDocument pcmlDoc, final PortObject[] inObjects) {
        PCML pcml = pcmlDoc.getPCML();
        ProcessChain pChain = pcml.addNewProcessChain();

        // Fetches model metadata from the 1st table (metadata table)

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 createPcData has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private void createPcData(PCMLDocument pcmlDoc, final PortObject[] inObjects) {
        PCML pcml = pcmlDoc.getPCML();
        ProcessChain pChain = pcml.addNewProcessChain();

        // Fetches model metadata from the 1st table (metadata table)

Method fetchConditions has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private List<ConditionsData> fetchConditions(BufferedDataTable table) {

        /**
         * Two types of conditions tables:
         * <ol>

Method createDataTable has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private DataTable createDataTable(ExpColumnList colList, List<DataPoint> dataPoints) {
        DataTable table = DataTable.Factory.newInstance();
        
        table.setColumnList(colList.columnList);

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

    private LinkedList<DataPoint> getDataPoints(LinkedList<ConcentrationData> concs, LinkedList<ConditionsData> conds) {

        // Gets time values
        List<Integer> timeValues = new LinkedList<>();
        for (ConcentrationData conc : concs) {

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 getDataPoints has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private LinkedList<DataPoint> getDataPoints(LinkedList<ConcentrationData> concs, LinkedList<ConditionsData> conds) {

        // Gets time values
        List<Integer> timeValues = new LinkedList<>();
        for (ConcentrationData conc : concs) {

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

    private List<ConditionsData> fetchConditions(BufferedDataTable table) {

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 22 to the 15 allowed.
Open

    private DataTable createDataTable(ExpColumnList colList, List<DataPoint> dataPoints) {

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 18 to the 15 allowed.
Open

    private void createPcData(PCMLDocument pcmlDoc, final PortObject[] inObjects) {

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

Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.
Open

    protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {

There are several reasons for a method not to have a method body:

  • It is an unintentional omission, and should be fixed to prevent an unexpected behavior in production.
  • It is not yet, or never will be, supported. In this case an UnsupportedOperationException should be thrown.
  • The method is an intentionally-blank override. In this case a nested comment should explain the reason for the blank override.

Noncompliant Code Example

public void doSomething() {
}

public void doSomethingElse() {
}

Compliant Solution

@Override
public void doSomething() {
  // Do nothing because of X and Y.
}

@Override
public void doSomethingElse() {
  throw new UnsupportedOperationException();
}

Exceptions

Default (no-argument) constructors are ignored when there are other constructors in the class, as are empty methods in abstract classes.

public abstract class Animal {
  void speak() {  // default implementation ignored
  }
}

Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.
Open

    protected void reset() {

There are several reasons for a method not to have a method body:

  • It is an unintentional omission, and should be fixed to prevent an unexpected behavior in production.
  • It is not yet, or never will be, supported. In this case an UnsupportedOperationException should be thrown.
  • The method is an intentionally-blank override. In this case a nested comment should explain the reason for the blank override.

Noncompliant Code Example

public void doSomething() {
}

public void doSomethingElse() {
}

Compliant Solution

@Override
public void doSomething() {
  // Do nothing because of X and Y.
}

@Override
public void doSomethingElse() {
  throw new UnsupportedOperationException();
}

Exceptions

Default (no-argument) constructors are ignored when there are other constructors in the class, as are empty methods in abstract classes.

public abstract class Animal {
  void speak() {  // default implementation ignored
  }
}

Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.
Open

    protected void loadInternals(final File internDir, final ExecutionMonitor exec)

There are several reasons for a method not to have a method body:

  • It is an unintentional omission, and should be fixed to prevent an unexpected behavior in production.
  • It is not yet, or never will be, supported. In this case an UnsupportedOperationException should be thrown.
  • The method is an intentionally-blank override. In this case a nested comment should explain the reason for the blank override.

Noncompliant Code Example

public void doSomething() {
}

public void doSomethingElse() {
}

Compliant Solution

@Override
public void doSomething() {
  // Do nothing because of X and Y.
}

@Override
public void doSomethingElse() {
  throw new UnsupportedOperationException();
}

Exceptions

Default (no-argument) constructors are ignored when there are other constructors in the class, as are empty methods in abstract classes.

public abstract class Animal {
  void speak() {  // default implementation ignored
  }
}

Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.
Open

    protected void saveInternals(final File internDir, final ExecutionMonitor exec)

There are several reasons for a method not to have a method body:

  • It is an unintentional omission, and should be fixed to prevent an unexpected behavior in production.
  • It is not yet, or never will be, supported. In this case an UnsupportedOperationException should be thrown.
  • The method is an intentionally-blank override. In this case a nested comment should explain the reason for the blank override.

Noncompliant Code Example

public void doSomething() {
}

public void doSomethingElse() {
}

Compliant Solution

@Override
public void doSomething() {
  // Do nothing because of X and Y.
}

@Override
public void doSomethingElse() {
  throw new UnsupportedOperationException();
}

Exceptions

Default (no-argument) constructors are ignored when there are other constructors in the class, as are empty methods in abstract classes.

public abstract class Animal {
  void speak() {  // default implementation ignored
  }
}

Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.
Open

    protected void loadValidatedSettingsFrom(final NodeSettingsRO settings) throws InvalidSettingsException {

There are several reasons for a method not to have a method body:

  • It is an unintentional omission, and should be fixed to prevent an unexpected behavior in production.
  • It is not yet, or never will be, supported. In this case an UnsupportedOperationException should be thrown.
  • The method is an intentionally-blank override. In this case a nested comment should explain the reason for the blank override.

Noncompliant Code Example

public void doSomething() {
}

public void doSomethingElse() {
}

Compliant Solution

@Override
public void doSomething() {
  // Do nothing because of X and Y.
}

@Override
public void doSomethingElse() {
  throw new UnsupportedOperationException();
}

Exceptions

Default (no-argument) constructors are ignored when there are other constructors in the class, as are empty methods in abstract classes.

public abstract class Animal {
  void speak() {  // default implementation ignored
  }
}

Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.
Open

    protected void saveSettingsTo(final NodeSettingsWO settings) {

There are several reasons for a method not to have a method body:

  • It is an unintentional omission, and should be fixed to prevent an unexpected behavior in production.
  • It is not yet, or never will be, supported. In this case an UnsupportedOperationException should be thrown.
  • The method is an intentionally-blank override. In this case a nested comment should explain the reason for the blank override.

Noncompliant Code Example

public void doSomething() {
}

public void doSomethingElse() {
}

Compliant Solution

@Override
public void doSomething() {
  // Do nothing because of X and Y.
}

@Override
public void doSomethingElse() {
  throw new UnsupportedOperationException();
}

Exceptions

Default (no-argument) constructors are ignored when there are other constructors in the class, as are empty methods in abstract classes.

public abstract class Animal {
  void speak() {  // default implementation ignored
  }
}

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

    public ConditionsData(int modelID, int time, Float temp, Float pH, Float nacl, Float aw, Float waterConc,
            Integer airHum, String procName, String comment) {
        this.modelID = modelID;
        this.time = time;
        this.temp = temp;
de.bund.bfr.knime.pmm.common/src/de/bund/bfr/knime/pmm/common/TimeSeriesXml.java on lines 51..64
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/modelestimation/SecondaryEstimationThread.java on lines 72..88

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

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

    DataPoint(int time, Float conc, Float temp, Float pH, Float nacl, Float aw, Float waterConc, Integer airHum) {
        this.time = time;
        this.conc = conc;
        this.temp = temp;
        this.pH = pH;
de.bund.bfr.knime.pmm.common/src/de/bund/bfr/knime/pmm/common/MiscXml.java on lines 66..76
de.bund.bfr.knime.pmm.common/src/de/bund/bfr/knime/pmm/common/units/CategoryReader.java on lines 127..138
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/modelestimation/PrimaryEstimationThread.java on lines 62..75

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

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

    public ModelMetadata(int modelID, String matrix, String matrixDetails, String agent, String agentDetails) {
        this.modelID = modelID;
        this.matrix = matrix;
        this.matrixDetails = matrixDetails;
        this.agent = agent;
de.bund.bfr.knime.pmm.common/src/de/bund/bfr/knime/pmm/common/DepXml.java on lines 62..68
de.bund.bfr.knime.pmm.common/src/de/bund/bfr/knime/pmm/common/MdInfoXml.java on lines 35..41
de.bund.bfr.knime.pmm.common/src/de/bund/bfr/knime/pmm/extendedtable/items/AgentXml.java on lines 57..63
de.bund.bfr.knime.pmm.common/src/de/bund/bfr/knime/pmm/extendedtable/items/MatrixXml.java on lines 57..63
org.hsh.bfr.db/src/org/hsh/bfr/db/gui/dbtree/MyDBTreeNode.java on lines 36..42

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

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 (row.getCell(3).isMissing()) {
                pH = null;
            } else {
                pH = (float) ((DoubleValue) row.getCell(3)).getDoubleValue();
            }
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 276..280

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

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 (row.getCell(2).isMissing()) {
                temperature = null;
            } else {
                temperature = (float) ((DoubleValue) row.getCell(2)).getDoubleValue();
            }
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 283..287

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

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

            if (dataPoint.nacl == null) {
                cur.insertElement(colList.naclColName);
            } else {
                cur.insertElementWithText(colList.naclColName, dataPoint.nacl.toString());
            }
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 400..404
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 406..410
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 418..422
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 424..428
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 430..434

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

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

            if (dataPoint.aw == null) {
                cur.insertElement(colList.awColName);
            } else {
                cur.insertElementWithText(colList.awColName, dataPoint.aw.toString());
            }
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 400..404
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 406..410
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 412..416
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 424..428
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 430..434

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

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

            if (dataPoint.waterConc == null) {
                cur.insertElement(colList.waterConcColName);
            } else {
                cur.insertElementWithText(colList.waterConcColName, dataPoint.waterConc.toString());
            }
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 400..404
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 406..410
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 412..416
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 418..422
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 430..434

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

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

            if (dataPoint.airHum == null) {
                cur.insertElement(colList.airHumColName);
            } else {
                cur.insertElementWithText(colList.airHumColName, dataPoint.airHum.toString());
            }
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 400..404
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 406..410
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 412..416
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 418..422
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 424..428

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

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

            if (dataPoint.pH == null) {
                cur.insertElement(colList.pHColName);
            } else {
                cur.insertElementWithText(colList.pHColName, dataPoint.pH.toString());
            }
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 400..404
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 412..416
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 418..422
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 424..428
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 430..434

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

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

            if (dataPoint.temp == null) {
                cur.insertElement(colList.tempColName);
            } else {
                cur.insertElementWithText(colList.tempColName, dataPoint.temp.toString());
            }
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 406..410
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 412..416
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 418..422
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 424..428
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/xls2pcml/XLS2PCMLNodeModel.java on lines 430..434

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

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