SiLeBAT/FSK-Lab

View on GitHub

Showing 14,752 of 14,752 total issues

Method loadValidatedSettingsFrom has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    protected void loadValidatedSettingsFrom( final NodeSettingsRO settings )
            throws InvalidSettingsException {
        // OneStepFitTss
        if (settings.containsKey(PARAM_TSONESTEP)) {

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

    private void manageDBMinMax(ResultSet result, ParametricModel pm) throws SQLException {
        Array array = result.getArray(Bfrdb.ATT_PARAMNAME);
        Array arrayMin = result.getArray(Bfrdb.ATT_MINVALUE);
        Array arrayMax = result.getArray(Bfrdb.ATT_MAXVALUE);
        Array arrayCat = result.getArray("ParCategory");

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

    @Override
    public BufferedDataTable getOutputTable(String assignments,
            ExecutionContext exec) throws CanceledExecutionException,
            ConvertException {
        BufferedDataContainer container = exec

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

    public static void getPaper(final int tableID, final String tablename, final String feldname, final int blobID) {
        try {
            ResultSet rs = getResultSet(
                    "SELECT "
                            + DBKernel.delimitL("Dateiname")
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/DBKernel.java - About 6 hrs to fix

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 ModelCombiner.java has 420 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

Function 12 has 152 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{}],12:[function(require,module,exports){
'use strict';
module.exports = function generate__limit(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;

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

                sql = "INSERT INTO " + DBKernel.delimitL("DoubleKennzahlen") +
            " (" + DBKernel.delimitL("Wert") + "," + DBKernel.delimitL("Exponent") + "," + DBKernel.delimitL("Wert_g") + "," + DBKernel.delimitL("Wert_typ") + "," +
                        DBKernel.delimitL("Wiederholungen") + "," + DBKernel.delimitL("Wiederholungen_g") + ", " +
                        DBKernel.delimitL("Standardabweichung") + "," + DBKernel.delimitL("Standardabweichung_exp") + ", " + DBKernel.delimitL("Standardabweichung_g") + ", " +
                        DBKernel.delimitL("Minimum") + ", " + DBKernel.delimitL("Minimum_exp") + ", " + DBKernel.delimitL("Minimum_g") + ", " +
org.hsh.bfr.db/src/org/hsh/bfr/db/gui/dbtable/editoren/MyNewDoubleEditor.java on lines 832..843

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

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

                        sql = "UPDATE " + DBKernel.delimitL("DoubleKennzahlen") +
                    " SET " + DBKernel.delimitL("Wert") + "=?," + DBKernel.delimitL("Exponent") + "=?," + DBKernel.delimitL("Wert_g") + "=?," + DBKernel.delimitL("Wert_typ") + "=?," +
                        DBKernel.delimitL("Wiederholungen") + "=?," + DBKernel.delimitL("Wiederholungen_g") + "=?, " + 
                        DBKernel.delimitL("Standardabweichung") + "=?," + DBKernel.delimitL("Standardabweichung_exp") + "=?, " + DBKernel.delimitL("Standardabweichung_g") + "=?, " +
                        DBKernel.delimitL("Minimum") + "=?, " + DBKernel.delimitL("Minimum_exp") + "=?, " + DBKernel.delimitL("Minimum_g") + "=?, " +
org.hsh.bfr.db/src/org/hsh/bfr/db/gui/dbtable/editoren/MyNewDoubleEditor.java on lines 847..859

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

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

    public static void replaceCelsiusAndFahrenheit(KnimeTuple tuple) {
        final String CELSIUS = "°C";
        final String FAHRENHEIT = "°F";
        final String KELVIN = "K";
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/sbmlwriter/SBMLWriterNodeModel.java on lines 381..423

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

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 static void replaceCelsiusAndFahrenheit(KnimeTuple tuple) {
            final String CELSIUS = "°C";
            final String FAHRENHEIT = "°F";
            final String KELVIN = "K";
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/common/writer/TableReader.java on lines 44..84

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

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 (y) {
        y0 = z[0], y1 = z[1];
        if (x) y0 = y0[1], y1 = y1[1];
        yExtentDomain = [ y0, y1 ];
        if (y.invert) y0 = y(y0), y1 = y(y1);
de.bund.bfr.knime.pmm.nodes/js-src/de/bund/bfr/knime/pmm/js/modelplotter/d3.js on lines 8289..8296

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

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 (x) {
        x0 = z[0], x1 = z[1];
        if (y) x0 = x0[0], x1 = x1[0];
        xExtentDomain = [ x0, x1 ];
        if (x.invert) x0 = x(x0), x1 = x(x1);
de.bund.bfr.knime.pmm.nodes/js-src/de/bund/bfr/knime/pmm/js/modelplotter/d3.js on lines 8297..8304

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

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

        switch (newValueText) {
          case "firstModel":
            if (poolSize == 2) {
              newSuffix = 1;
            } else if (poolSize == 3) {
de.bund.bfr.knime.fsklab.nodes/js-src/de/bund/bfr/knime/fsklab/v2.0/joiner/joiner.js on lines 753..784

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

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

        switch (previous) {
          case "firstModel":
            if (poolSize == 2) {
              oldSuffix = 1;
            } else if (poolSize == 3) {
de.bund.bfr.knime.fsklab.nodes/js-src/de/bund/bfr/knime/fsklab/v2.0/joiner/joiner.js on lines 785..815

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

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

Method getOutputTable has 151 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Override
    public BufferedDataTable getOutputTable(String assignments,
            ExecutionContext exec) throws CanceledExecutionException,
            ConvertException {
        BufferedDataContainer buf = exec.createDataContainer(SchemaFactory

Function fill has 151 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        fill: function(){
            var d = new Date(this.viewDate),
                year = d.getUTCFullYear(),
                month = d.getUTCMonth(),
                startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity,
Severity: Major
Found in de.bund.bfr.knime.js/src/js/lib/bootstrap-datepicker.js - About 6 hrs to fix

Method performExecuteCreatePortObjects has 150 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Override
    protected PortObject[] performExecuteCreatePortObjects(PortObject svgImageFromView, PortObject[] inObjects,
            ExecutionContext exec) throws Exception {

        BufferedDataTable table = (BufferedDataTable) inObjects[0];

SettingsHelper has 44 methods (exceeds 20 allowed). Consider refactoring.
Open

public class SettingsHelper {

    protected static final String CFG_SELECTEDIDS = "SelectedIDs";
    protected static final String CFG_COLORS = "Colors";
    protected static final String CFG_SHAPES = "Shapes";

Method computeSecondary has 150 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static List<KnimeTuple> computeSecondary(List<KnimeTuple> tuples) {
        Set<String> idSet = new LinkedHashSet<>();
        Map<String, String> formulaMap = new LinkedHashMap<>();
        Map<String, PmmXmlDoc> paramMap = new LinkedHashMap<>();
        Map<String, String> depVarMap = new LinkedHashMap<>();

Function parseTretiaryModels has 150 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function parseTretiaryModels(modelList){
            /*
             * we use the primary model data as a foundation for the tertiary model
             * this applies to the attributes that are equal in all secondary models/data rows
             */
Severity
Category
Status
Source
Language