SiLeBAT/FSK-Lab

View on GitHub

Showing 14,752 of 14,752 total issues

Method defineTable4NewDBTable has 144 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private boolean defineTable4NewDBTable(MyTable myT, MyDBTable dbTable, final Object value, final Object headerValue, final MyTable theNewTable, MyDBTable newDBTable, final Integer row, final Integer col, final Object[][] conditions) {
        boolean disableButtons = false;
        /*
         * String tn = ""; if (myT != null) { tn = myT.getTablename(); } if (myT
         * != null && tn.equals("Zutatendaten") && headerValue != null &&
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/MainFrame.java - About 5 hrs to fix

Method runFskPortObject has 144 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  public FskPortObject runFskPortObject(ScriptHandler handler, FskPortObject fskObj,
      ExecutionContext exec) throws Exception {
    LOGGER.info("Running Model: " + fskObj);
    if (fskObj instanceof CombinedFskPortObject) {
      CombinedFskPortObject comFskObj = (CombinedFskPortObject) fskObj;

Function _bindEvents has 144 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      function _bindEvents() {
        originalinput.on('keydown.touchspin', function(ev) {
          var code = ev.keyCode || ev.which;

          if (code === 38) {
Severity: Major
Found in de.bund.bfr.knime.js/src/js/lib/bootstrap-touchspin.js - About 5 hrs to fix

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

    @Override
    protected BufferedDataTable[] execute(final BufferedDataTable[] inData,
            final ExecutionContext exec) throws Exception {
        KnimeRelationReader reader = new KnimeRelationReader(
                SchemaFactory.createDataSchema(), inData[0]);

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

    @Override
    public void itemStateChanged(ItemEvent e) {
        if (e.getStateChange() != ItemEvent.SELECTED) {
            return;
        }

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

    private void readValues() {
        textField1.setText(""); textField1_exp.setText(""); checkBox1.setSelected(false);
        comboBox2.setSelectedIndex(0);
        textField3.setText(""); checkBox3.setSelected(false);
        textField4.setText(""); textField4_exp.setText(""); checkBox4.setSelected(false);

Cognitive Complexity

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

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

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

Further reading

Method go4ISM has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

    private void go4ISM(PlausibleDialog4Krise pd4) throws SQLException {
        DBKernel.sendRequest("DROP FUNCTION IF EXISTS LD", false, true);
        if (DBKernel.sendRequest(
                "CREATE FUNCTION LD(x VARCHAR(255), y VARCHAR(255))\n" +
                "RETURNS INT\n" + 
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/actions/PlausibleAction.java - About 5 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

Method checkForeignWindow2Open has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

  private void checkForeignWindow2Open(final int row, final int col) {
    MyTable[] myTs = actualTable.getForeignFields();
    //System.out.println(lastClickedRow + "\t" + lastClickedCol + "\t" + myTs.length);
    if (col > 0 && col <= myTs.length && myTs[col-1] != null &&
            !myTs[col-1].getTablename().equals("DoubleKennzahlen")) { 
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/dbtable/MyDBTable.java - About 5 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

Method loadSettings has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

    public void loadSettings(NodeSettingsRO settings) {
        try {
            fileName = settings.getString(CFG_FILE_NAME);
        } catch (InvalidSettingsException 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 doExport has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

    public void doExport(final String filename, final MyDBTable myDB, final JProgressBar progress, final boolean exportFulltext, final String zeilen2Do) {
        //filename = "C:/Users/Armin/Documents/private/freelance/BfR/Data/100716/Matrices_BLS-Liste.xls";
      Runnable runnable = new Runnable() {
      public void run() {
            try {
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/exports/ExcelExport.java - About 5 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

Method updateParamValues has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

    private static void updateParamValues(List<KnimeTuple> tuples,
            Map<KnimeTuple, List<KnimeTuple>> tupleCombinations) {
        Map<Integer, Map<String, Double>> paramSums = new LinkedHashMap<>();
        Map<Integer, Map<String, Integer>> paramCounts = new LinkedHashMap<>();
        Map<Integer, Map<String, Double>> paramValues = new LinkedHashMap<>();

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

    public BufferedDataTable execute(final ExecutionContext exec) {
        Map<NameAndDbId, Integer> columns = createColumnMap(pcmlDoc);
        Map<String, ProcessNode> processNodes = createProcessNodeMap(pcmlDoc);

        Double timeDiff = 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

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

            if ( !o.axis || o.axis !== "x" ) {
                if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY < o.scrollSensitivity ) {
                    scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed;
                } else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) {
                    scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed;
de.bund.bfr.knime.pmm.nodes/js-src/de/bund/bfr/knime/pmm/js/modelplotter/jquery-ui.js on lines 2501..2507

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

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 ( !o.axis || o.axis !== "y" ) {
                if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX < o.scrollSensitivity ) {
                    scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed;
                } else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) {
                    scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed;
de.bund.bfr.knime.pmm.nodes/js-src/de/bund/bfr/knime/pmm/js/modelplotter/jquery-ui.js on lines 2493..2499

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

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

File OneStepEstimationThread.java has 406 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

File JSONDataTable.java has 405 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package de.bund.bfr.knime.node.editableTable;

/*
 * ------------------------------------------------------------------------
 *  Copyright by KNIME GmbH, Konstanz, Germany

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

            if (this.dates.length)
                this.viewDate = new Date(this.dates.get(-1));
            else if (this.viewDate < this.o.startDate)
                this.viewDate = new Date(this.o.startDate);
            else if (this.viewDate > this.o.endDate)
de.bund.bfr.knime.js/src/js/lib/bootstrap-datepicker.js on lines 784..791

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

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

            if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date)){
                date = new Date();
                for (i=0; i < parts.length; i++){
                    part = part_re.exec(parts[i]);
                    dir = parseInt(part[1]);
de.bund.bfr.knime.fsklab.deprecatednodes/js-src/bootstrap-datepicker/1_6_4/debug/js/bootstrap-datepicker.js on lines 1871..1881

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

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

                if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date)){
                    date = new Date();
                      for (i=0; i < parts.length; i++){
                        part = part_re.exec(parts[i]);
                        dir = parseInt(part[1]);
de.bund.bfr.knime.fsklab.deprecatednodes/js-src/bootstrap-datepicker/1_6_4/debug/js/bootstrap-datepicker.js on lines 1856..1865

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

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

                if (this.dates.length)
                    this.viewDate = new Date(this.dates.get(-1));
                else if (this.viewDate < this.o.startDate)
                    this.viewDate = new Date(this.o.startDate);
                else if (this.viewDate > this.o.endDate)
Severity: Major
Found in de.bund.bfr.knime.js/src/js/lib/bootstrap-datepicker.js and 1 other location - About 5 hrs to fix
de.bund.bfr.knime.fsklab.deprecatednodes/js-src/bootstrap-datepicker/1_6_4/debug/js/bootstrap-datepicker.js on lines 780..787

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

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

Severity
Category
Status
Source
Language