SiLeBAT/FSK-Lab

View on GitHub

Showing 14,752 of 14,752 total issues

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

module.exports = function generate__limit(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];

File StudyImpl.java has 416 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 */
package metadata.impl;

import java.net.URI;

File MetaDataPane.java has 416 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package de.bund.bfr.knime.fsklab.nodes.common.ui;

import java.text.ParseException;
import java.util.Arrays;
import java.util.LinkedHashMap;

Function tokenize has 149 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function tokenize(stream, state) {
      // Finally advance the stream
      var ch = stream.next();

      // BLOCKCOMMENT
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/sas/sas.js - About 5 hrs to fix

Function exports has 149 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function (grunt) {
    require('load-grunt-tasks')(grunt);
    const sass = require('node-sass');
 
    grunt.initConfig({
Severity: Major
Found in de.bund.bfr.knime.js/Gruntfile.js - About 5 hrs to fix

Function parseDate has 149 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    parseDate: function (format, value, settings) {
        if (format == null || value == null) {
            throw "Invalid arguments";
        }

Function fill has 149 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,

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

    _appendTo: function() {
        var element = this.options.appendTo;

        if ( element ) {
            element = element.jquery || element.nodeType ?
de.bund.bfr.knime.pmm.nodes/js-src/de/bund/bfr/knime/pmm/js/modelplotter/jquery-ui.js on lines 7310..7328

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

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

    _appendTo: function() {
        var element = this.options.appendTo;

        if ( element ) {
            element = element.jquery || element.nodeType ?
de.bund.bfr.knime.pmm.nodes/js-src/de/bund/bfr/knime/pmm/js/modelplotter/jquery-ui.js on lines 11581..11599

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

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 = "SELECT " + DBKernel.delimitL("Artikelnummer") + "," + DBKernel.delimitL("Bezeichnung") + "," + DBKernel.delimitL("ChargenNr") + "," +
                DBKernel.delimitL("MHD_day") + "," + DBKernel.delimitL("MHD_month") + "," + DBKernel.delimitL("MHD_year") + "," +
                DBKernel.delimitL("pd_day") + "," + DBKernel.delimitL("pd_month") + "," + DBKernel.delimitL("pd_year") + "," +
                DBKernel.delimitL("dd_day") + "," + DBKernel.delimitL("dd_month") + "," + DBKernel.delimitL("dd_year") + "," +
                DBKernel.delimitL("Unitmenge") + "," + DBKernel.delimitL("UnitEinheit") + "," + DBKernel.delimitL("numPU") + "," + DBKernel.delimitL("typePU") + "," +
org.hsh.bfr.db/src/org/hsh/bfr/db/gui/actions/PlausibleAction.java on lines 226..237

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

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

        String sql = "SELECT " + DBKernel.delimitL("Artikelnummer") + "," + DBKernel.delimitL("Bezeichnung") + "," + DBKernel.delimitL("ChargenNr") + "," +
                DBKernel.delimitL("MHD_day") + "," + DBKernel.delimitL("MHD_month") + "," + DBKernel.delimitL("MHD_year") + "," +
                DBKernel.delimitL("pd_day") + "," + DBKernel.delimitL("pd_month") + "," + DBKernel.delimitL("pd_year") + "," +
                DBKernel.delimitL("dd_day") + "," + DBKernel.delimitL("dd_month") + "," + DBKernel.delimitL("dd_year") + "," +
                DBKernel.delimitL("Unitmenge") + "," + DBKernel.delimitL("UnitEinheit") + "," + DBKernel.delimitL("numPU") + "," + DBKernel.delimitL("typePU") + "," +
org.hsh.bfr.db/src/org/hsh/bfr/db/gui/actions/PlausibleAction.java on lines 255..266

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

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

    private void updateModelPanel() {
        for (String param : set.getSecModelTuples().keySet()) {
            if (!set.getSecModelMappings().containsKey(param)) {
                set.getSecModelMappings().put(param, new LinkedHashMap<String, String>());
            }

Method yylex has 148 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private org.fife.ui.rsyntaxtextarea.Token yylex() {
        int zzInput;
        int zzAction;

        // cached fields:

Method yylex has 148 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private org.fife.ui.rsyntaxtextarea.Token yylex() {
        int zzInput;
        int zzAction;

        // cached fields:

Method yylex has 148 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private org.fife.ui.rsyntaxtextarea.Token yylex() {
        int zzInput;
        int zzAction;

        // cached fields:

Function calc has 148 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        calc: function (update) {
            if (!this.options) {
                return;
            }

Severity: Major
Found in de.bund.bfr.knime.js/src/js/lib/ion.rangeSlider.js - About 5 hrs to fix

Method convertPopulationGroup has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
Open

    static PopulationGroup convertPopulationGroup(JsonNode node) {

        PopulationGroup group = new PopulationGroup();

        if (node.has("populationName")) {

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

  @Override
public void keyTyped(final KeyEvent keyEvent) {
      char ch = keyEvent.getKeyChar();
      //System.out.println(ch + "\t" + keyEvent.isConsumed());
    if (ch == KeyEvent.VK_TAB || ch == KeyEvent.VK_ENTER && !keyEvent.isAltDown() && !keyEvent.isControlDown()) {
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 insertM has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
Open

    public Integer insertM(final ParametricModel m) {
        int modelId = m.modelId;
        Integer fID = getId4Formula(m.getFormula(), m.getLevel(), modelId);
        boolean iop = isObjectPresent("Modellkatalog", modelId);

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 ModelEstimationNodeDialog.java has 413 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
Severity
Category
Status
Source
Language