SiLeBAT/FSK-Lab

View on GitHub
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java

Summary

Maintainability
F
2 wks
Test Coverage

Method execute has a Cognitive Complexity of 199 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    protected PortObject[] execute(final PortObject[] inObjects, 
            final ExecutionContext exec) {
        PCMLDocument pcmlDoc = PCMLUtil.merge(inObjects);

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

File FoodProcessNodeModel.java has 805 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 getNewConc has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring.
Open

    private Double getNewConc(ValueAndUnit vau, PredictionValues pv, ParametersSetting ps, Double tempVal, Double phVal, Double awVal, Double presVal, double t, String timeUnit, Double lastConc, double stepWidth) {
        Double newVal = vau.getValue();
        boolean isPercent = false;

        PredictorViewNodeDialog pvnd = pv.getPvnd();

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

    @Override
    protected PortObject[] execute(final PortObject[] inObjects, 
            final ExecutionContext exec) {
        PCMLDocument pcmlDoc = PCMLUtil.merge(inObjects);

Method calculateInstantMixture has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
Open

    static PCMLPortObjectSpec calculateInstantMixture(final PortObjectSpec[] inSpecs, final FoodProcessSetting fps, FoodProcessNodeModel fpnm) {
        HashMap<Matrix, Double> newMatrixMix = new HashMap<Matrix, Double>();
        HashMap<Agent, ValueAndUnit> newAgentMix = new HashMap<Agent, ValueAndUnit>();
        Double fpVolume = null, newTemperature = null, newpH = null, newAw = null, newPressure = null;//, fpFlowSpeed = null, flowSpeedSum = 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

Method calculateInstantMixture has 93 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    static PCMLPortObjectSpec calculateInstantMixture(final PortObjectSpec[] inSpecs, final FoodProcessSetting fps, FoodProcessNodeModel fpnm) {
        HashMap<Matrix, Double> newMatrixMix = new HashMap<Matrix, Double>();
        HashMap<Agent, ValueAndUnit> newAgentMix = new HashMap<Agent, ValueAndUnit>();
        Double fpVolume = null, newTemperature = null, newpH = null, newAw = null, newPressure = null;//, fpFlowSpeed = null, flowSpeedSum = null;
        

FoodProcessNodeModel has 26 methods (exceeds 20 allowed). Consider refactoring.
Open

public class FoodProcessNodeModel extends NodeModel {
    public static final int N_PORT_IN = 4;
    public static final int N_PORT_OUT = 4;
    public static String defaultBacterialUnit = "log10(count/g)";
    private static boolean doModelsOut = false;

Method getNewConc has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private Double getNewConc(ValueAndUnit vau, PredictionValues pv, ParametersSetting ps, Double tempVal, Double phVal, Double awVal, Double presVal, double t, String timeUnit, Double lastConc, double stepWidth) {
        Double newVal = vau.getValue();
        boolean isPercent = false;

        PredictorViewNodeDialog pvnd = pv.getPvnd();

Method createPCMLSpec has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    private PCMLPortObjectSpec createPCMLSpec(final int outIndex, PCMLPortObjectSpec instantMix, final FoodProcessSetting fps,
            Map<Agent, ValueAndUnit> lastAgentsQ) {
        OutPortSetting[] ops = fps.getOutPortSetting();
        // erst einmal erhalten alle OutPorts denselben Mix - im Nachgang für jeden OutPORT INDIVIDUELL MACHEN, "Expert mode"
        

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

    private static Double calculateWeightedMean(Double sum, final Double newVal, final Double partVol, final Double totalVol,
            final String defaultValue) {
        // hier erstmal trivial ohne grosse Mischerei...
        if (defaultValue != null && !defaultValue.isEmpty()) {
            try{sum = Double.parseDouble(defaultValue);}catch(Exception e){}

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 getNewConc has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

    private Double getNewConc(ValueAndUnit vau, PredictionValues pv, ParametersSetting ps, Double tempVal, Double phVal, Double awVal, Double presVal, double t, String timeUnit, Double lastConc, double stepWidth) {

Method createPCMLSpec has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private PCMLPortObjectSpec createPCMLSpec(final int outIndex, PCMLPortObjectSpec instantMix, final FoodProcessSetting fps,
            Map<Agent, ValueAndUnit> lastAgentsQ) {
        OutPortSetting[] ops = fps.getOutPortSetting();
        // erst einmal erhalten alle OutPorts denselben Mix - im Nachgang für jeden OutPORT INDIVIDUELL MACHEN, "Expert mode"
        

Method calculateNewTimes has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private void calculateNewTimes(final Map<String, ProcessNode> processNodes, final Map<String, ProcessData> processChainData,
            final ProcessNode processNode, final Double time) {
        Inport[] in = processNode.getInportArray();
        for (int i = 0; i < in.length; i++) {
            OutportRef opr = in[i].getOutportRef();

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 (doc != null) {
                            for (PmmXmlElementConvertable el : doc.getElementSet()) {
                                if (el instanceof DepXml) {
                                    DepXml x = (DepXml) el;
                                    pv.setUnitLog10N(x.unit);

Avoid deeply nested control flow statements.
Open

                        if (doc != null) {
                            for (PmmXmlElementConvertable el : doc.getElementSet()) {
                                if (el instanceof ParamXml) {
                                    ParamXml x = (ParamXml) el;
                                    if (x.name.equals(pv.getLog10N0())) pv.setUnitLog10N0(x.unit);

Avoid deeply nested control flow statements.
Open

                        if (selModelID != null) {
                            if (set.getNewConcentrationParameters().containsKey(selModelID) && set.getNewConcentrationParameters().get(selModelID) != null) {
                                pv.setLog10N0(set.getNewConcentrationParameters().get(selModelID));
                            }
                            if (set.getNewLagParameters().containsKey(selModelID) && set.getNewLagParameters().get(selModelID) != null) {

Avoid deeply nested control flow statements.
Open

                        if (doc != null) {
                            for (PmmXmlElementConvertable el : doc.getElementSet()) {
                                if (el instanceof IndepXml) {
                                    IndepXml x = (IndepXml) el;
                                    if (x.name.equals(AttributeUtilities.ATT_TEMPERATURE) && x.unit != null) pv.setUnitTemp(x.unit);

Avoid deeply nested control flow statements.
Open

                        if (doc != null) {
                            for (PmmXmlElementConvertable el : doc.getElementSet()) {
                                if (el instanceof CatalogModelXml) {
                                    CatalogModelXml x = (CatalogModelXml) el;
                                    selModelID = ""+x.id;

Avoid deeply nested control flow statements.
Open

                        if (fpVolume == null) fpVolume = 0.0;

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

    private void loadEstModelGui(final NodeSettingsRO settings) throws InvalidSettingsException {
        try {
            emReaderUiMap = new HashMap<String, EmReaderUi>();
            if (settings.containsKey("EstModelReaderUi")) {
                Config c = settings.getConfig("EstModelReaderUi");

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 (newAgentMix.containsKey(a)) {
                            if (newAgentMix.get(a).getUnit().equals(vau.getUnit())) { // ppm oder log10 count/g - es kann nur einer überleben!!! D.h. innerhalb eines Workflows muss ein Agent dieselbe Einheitenkategorie haben!!!
                                newFraction = calcNewAgentFraction(vau, newFraction, relation, newAgentMix.get(a).getValue());
                                newAgentMix.remove(a);
                            }

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

    private static Double calculateWeightedMean(Double sum, final Double newVal, final Double partVol, final Double totalVol,
            final String defaultValue) {

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

    private Double getYVal(final XYSeries xy, final double xVal) {
        Double result = null;
        if (xy != null) {
            for (int i=0;i<xy.getItemCount();i++) {
                if (xy.getDataItem(i).getXValue() == xVal) {

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

    private Double getTime(PredictorViewNodeDialog pvnd, double logC) {
        List<Double> tv = new ArrayList<Double>();
        tv.add(logC);
        ChartSamplePanel samplePanel = pvnd.getSamplePanel();
        ChartConfigPanel c = pvnd.getChartAllPanel().getConfigPanel();

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

    protected PortObject[] execute(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

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

    private Double getNewConc(ValueAndUnit vau, PredictionValues pv, ParametersSetting ps, Double tempVal, Double phVal, Double awVal, Double presVal, double t, String timeUnit, Double lastConc, double stepWidth) {

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 PCMLPortObjectSpec createPCMLSpec(final int outIndex, PCMLPortObjectSpec instantMix, final FoodProcessSetting fps,

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

    static PCMLPortObjectSpec calculateInstantMixture(final PortObjectSpec[] inSpecs, final FoodProcessSetting fps, FoodProcessNodeModel fpnm) {

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

Make the enclosing method "static" or remove this set.
Open

                    if (warnings.indexOf("Agent conc calculation failed\n") < 0) warnings += "Agent conc calculation failed\n";

Correctly updating a static field from a non-static method is tricky to get right and could easily lead to bugs if there are multiple class instances and/or multiple threads in play. Ideally, static fields are only updated from synchronized static methods.

This rule raises an issue each time a static field is updated from a non-static method.

Noncompliant Code Example

public class MyClass {

  private static int count = 0;

  public void doSomething() {
    //...
    count++;  // Noncompliant
  }
}

Define a constant instead of duplicating this literal "Pressure" 5 times.
Open

    private static Category presCat = Categories.getCategory("Pressure");

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

public void run() {
  prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
  execute("action1");
  release("action1");
}

@SuppressWarning("all")                            // Compliant - annotations are excluded
private void method1() { /* ... */ }
@SuppressWarning("all")
private void method2() { /* ... */ }

public String method3(String a) {
  System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
  return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
}

Compliant Solution

private static final String ACTION_1 = "action1";  // Compliant

public void run() {
  prepare(ACTION_1);                               // Compliant
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Make the enclosing method "static" or remove this set.
Open

                        if (warnings.indexOf("Some concentrations are not calculatable\n") < 0) warnings += "Some concentrations are not calculatable\n";

Correctly updating a static field from a non-static method is tricky to get right and could easily lead to bugs if there are multiple class instances and/or multiple threads in play. Ideally, static fields are only updated from synchronized static methods.

This rule raises an issue each time a static field is updated from a non-static method.

Noncompliant Code Example

public class MyClass {

  private static int count = 0;

  public void doSomething() {
    //...
    count++;  // Noncompliant
  }
}

Define a constant instead of duplicating this literal "EstModelReaderUi" 4 times.
Open

                 c = c.addConfig("EstModelReaderUi");

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

public void run() {
  prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
  execute("action1");
  release("action1");
}

@SuppressWarning("all")                            // Compliant - annotations are excluded
private void method1() { /* ... */ }
@SuppressWarning("all")
private void method2() { /* ... */ }

public String method3(String a) {
  System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
  return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
}

Compliant Solution

private static final String ACTION_1 = "action1";  // Compliant

public void run() {
  prepare(ACTION_1);                               // Compliant
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Define a constant instead of duplicating this literal "Agents" 3 times.
Open

             settings.addStringArray("Agents", emReaderUiMap.keySet().toArray(new String[]{}));

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

public void run() {
  prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
  execute("action1");
  release("action1");
}

@SuppressWarning("all")                            // Compliant - annotations are excluded
private void method1() { /* ... */ }
@SuppressWarning("all")
private void method2() { /* ... */ }

public String method3(String a) {
  System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
  return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
}

Compliant Solution

private static final String ACTION_1 = "action1";  // Compliant

public void run() {
  prepare(ACTION_1);                               // Compliant
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Make the enclosing method "static" or remove this set.
Open

                    if (warnings.indexOf("Temperature not defined in Model\n") < 0) warnings += "Temperature not defined in Model\n";

Correctly updating a static field from a non-static method is tricky to get right and could easily lead to bugs if there are multiple class instances and/or multiple threads in play. Ideally, static fields are only updated from synchronized static methods.

This rule raises an issue each time a static field is updated from a non-static method.

Noncompliant Code Example

public class MyClass {

  private static int count = 0;

  public void doSomething() {
    //...
    count++;  // Noncompliant
  }
}

Make the enclosing method "static" or remove this set.
Open

                    if (warnings.indexOf("aw not defined in Model\n") < 0) warnings += "aw not defined in Model\n";

Correctly updating a static field from a non-static method is tricky to get right and could easily lead to bugs if there are multiple class instances and/or multiple threads in play. Ideally, static fields are only updated from synchronized static methods.

This rule raises an issue each time a static field is updated from a non-static method.

Noncompliant Code Example

public class MyClass {

  private static int count = 0;

  public void doSomething() {
    //...
    count++;  // Noncompliant
  }
}

Make the enclosing method "static" or remove this set.
Open

            if (warnings.indexOf(w + "\n") < 0) warnings += w + "\n";

Correctly updating a static field from a non-static method is tricky to get right and could easily lead to bugs if there are multiple class instances and/or multiple threads in play. Ideally, static fields are only updated from synchronized static methods.

This rule raises an issue each time a static field is updated from a non-static method.

Noncompliant Code Example

public class MyClass {

  private static int count = 0;

  public void doSomething() {
    //...
    count++;  // Noncompliant
  }
}

Make the enclosing method "static" or remove this set.
Open

        warnings = "";

Correctly updating a static field from a non-static method is tricky to get right and could easily lead to bugs if there are multiple class instances and/or multiple threads in play. Ideally, static fields are only updated from synchronized static methods.

This rule raises an issue each time a static field is updated from a non-static method.

Noncompliant Code Example

public class MyClass {

  private static int count = 0;

  public void doSomething() {
    //...
    count++;  // Noncompliant
  }
}

Make the enclosing method "static" or remove this set.
Open

                    if (warnings.indexOf("pH not defined in Model\n") < 0) warnings += "pH not defined in Model\n";

Correctly updating a static field from a non-static method is tricky to get right and could easily lead to bugs if there are multiple class instances and/or multiple threads in play. Ideally, static fields are only updated from synchronized static methods.

This rule raises an issue each time a static field is updated from a non-static method.

Noncompliant Code Example

public class MyClass {

  private static int count = 0;

  public void doSomething() {
    //...
    count++;  // Noncompliant
  }
}

Make the enclosing method "static" or remove this set.
Open

                    if (warnings.indexOf("Pressure not defined in Model\n") < 0) warnings += "Pressure not defined in Model\n";

Correctly updating a static field from a non-static method is tricky to get right and could easily lead to bugs if there are multiple class instances and/or multiple threads in play. Ideally, static fields are only updated from synchronized static methods.

This rule raises an issue each time a static field is updated from a non-static method.

Noncompliant Code Example

public class MyClass {

  private static int count = 0;

  public void doSomething() {
    //...
    count++;  // Noncompliant
  }
}

Make the enclosing method "static" or remove this set.
Open

            if (warnings.indexOf(w + "\n") < 0) warnings += w + "\n";

Correctly updating a static field from a non-static method is tricky to get right and could easily lead to bugs if there are multiple class instances and/or multiple threads in play. Ideally, static fields are only updated from synchronized static methods.

This rule raises an issue each time a static field is updated from a non-static method.

Noncompliant Code Example

public class MyClass {

  private static int count = 0;

  public void doSomething() {
    //...
    count++;  // Noncompliant
  }
}

Make sure "outFluxSum" can't be zero before doing this division.
Open

            double outFluxRelation = ops[outIndex].getOutFlux() / outFluxSum;

If the denominator to a division or modulo operation is zero it would result in a fatal error.

When working with double or float, no fatal error will be raised, but it will lead to unusual result and should be avoided anyway.

This rule supports primitive int, long, double, float as well as BigDecimal and BigInteger.

Noncompliant Code Example

void test_divide() {
  int z = 0;
  if (unknown()) {
    // ..
    z = 3;
  } else {
    // ..
  }
  z = 1 / z; // Noncompliant, possible division by zero
}

Compliant Solution

void test_divide() {
  int z = 0;
  if (unknown()) {
    // ..
    z = 3;
  } else {
    // ..
    z = 1;
  }
  z = 1 / z;
}

See

  • MITRE, CWE-369 - Divide by zero
  • CERT, NUM02-J. - Ensure that division and remainder operations do not result in divide-by-zero errors
  • CERT, INT33-C. - Ensure that division and remainder operations do not result in divide-by-zero errors

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

            if (warnings.indexOf(fromUnit + " <-> " + toUnit) < 0) {
                warnings += "Problems converting '" + cat.getName() + "': " + fromUnit + " <-> " + toUnit + "\n";
            }
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/db/WriterNodeModel.java on lines 290..292

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

                        System.err.println("not calculatable: " + lastConc + "\t" + lastConcConverted + "\t" + t + "\t" + newT + "\t" + tempVal + "\t" + phVal + "\t" + awVal);
de.bund.bfr.knime.pmm.bfrdbiface.lib/src/de/bund/bfr/knime/pmm/bfrdbiface/lib/Bfrdb.java on lines 556..557

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

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

                if (tempVal != null && (tempAlt == null || !gpv.containsKey(tempAlt))) {
                    if (warnings.indexOf("Temperature not defined in Model\n") < 0) warnings += "Temperature not defined in Model\n";
                    //System.err.println(tempVal);
                }
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 570..572
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 573..575

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

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

                if (phVal != null && (phAlt == null || !gpv.containsKey(phAlt))) {
                    if (warnings.indexOf("pH not defined in Model\n") < 0) warnings += "pH not defined in Model\n";
                }
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 566..569
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 573..575

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

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

                if (awVal != null && (awAlt == null || !gpv.containsKey(awAlt))) {
                    if (warnings.indexOf("aw not defined in Model\n") < 0) warnings += "aw not defined in Model\n";
                }
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 566..569
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 570..572

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

    private Map<String, ProcessNode> createProcessNodeMap(final PCMLDocument pcmlDoc) {
        Map<String, ProcessNode> processNodes = new HashMap<String, ProcessNode>();
        
        for (ProcessNode processNode : pcmlDoc.getPCML().getProcessChain().getProcessNodeArray()) {
            processNodes.put(processNode.getId(), processNode);
de.bund.bfr.knime.foodprocess.pcml/src/de/bund/bfr/knime/pcml/node/pcmltotable/PCMLDataTable.java on lines 192..200

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

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 (awVal == null) {
                    cur.insertElement(awCol);
                } else {
                    cur.insertElementWithText(awCol, awVal.toString());
                    lastAW = awVal.toString();
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 383..388
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 390..395
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 404..409

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

                if (tempVal == null) {
                    cur.insertElement(tempCol);
                } else {
                    cur.insertElementWithText(tempCol, tempVal.toString());
                    lastTemp = tempVal.toString();
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 390..395
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 397..402
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 404..409

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

                if (phVal == null) {
                    cur.insertElement(phCol);
                } else {
                    cur.insertElementWithText(phCol, phVal.toString());
                    lastPH = phVal.toString();
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 383..388
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 397..402
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 404..409

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

                if (presVal == null) {
                    cur.insertElement(pressureCol);
                } else {
                    cur.insertElementWithText(pressureCol, presVal.toString());
                    lastPres = presVal.toString();
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 383..388
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 390..395
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 397..402

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

        if (ps.getPh() == null || ps.getPh().isEmpty()) param.setPH(instantMix.getPH_value()+"");
        else param.setPH(ps.getPh());
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 189..190
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 191..192
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 195..196

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

        if (ps.getTemperature() == null || ps.getTemperature().isEmpty()) param.setTemperature(instantMix.getTemperature()+"");
        else param.setTemperature(getTemperature(ps));
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 191..192
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 193..194
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 195..196

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

                for (int i = 0; i < kts.size(); i++) {
                    buf.addRowToTable(new DefaultRow(String.valueOf(i), kts.get(i)));
                }
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/estimatedmodelreader/EstimatedModelReaderNodeModel.java on lines 540..542

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

        if (ps.getAw() == null || ps.getAw().isEmpty()) param.setAw(instantMix.getAw_value()+"");
        else param.setAw(ps.getAw());
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 189..190
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 193..194
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 195..196

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

        if (ps.getPressure() == null || ps.getPressure().isEmpty()) param.setPressure(instantMix.getPressure()+"");
        else param.setPressure(getPressure(ps));
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 189..190
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 191..192
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 193..194

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

        for (String w : pvnd.getWarnings()) {
            if (warnings.indexOf(w + "\n") < 0) warnings += w + "\n";
        }
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 636..638

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

        for (String w : pvnd.getWarnings()) {
            if (warnings.indexOf(w + "\n") < 0) warnings += w + "\n";
        }
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 648..650

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

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

                            if (set.getNewLagParameters().containsKey(selModelID) && set.getNewLagParameters().get(selModelID) != null) {
                                pv.setLag(set.getNewLagParameters().get(selModelID));
                            }
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 331..333

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

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

                            if (set.getNewConcentrationParameters().containsKey(selModelID) && set.getNewConcentrationParameters().get(selModelID) != null) {
                                pv.setLog10N0(set.getNewConcentrationParameters().get(selModelID));
                            }
de.bund.bfr.knime.foodprocess/src/de/bund/bfr/knime/foodprocess/FoodProcessNodeModel.java on lines 334..336

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