SiLeBAT/FSK-Lab

View on GitHub

Showing 14,752 of 14,752 total issues

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

  function tokenLiteral(quote) {
    return function(stream, state) {
      var escaped = false, ch;
      while ((ch = stream.next()) != null) {
        if (ch == quote && !escaped) {
de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/turtle/turtle.js on lines 77..89

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

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 RunnerNodeModel.java has 302 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 ***************************************************************************************************
 * Copyright (c) 2017 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

File app.utils.js has 302 lines of code (exceeds 250 allowed). Consider refactoring.
Open

 /** Temporary workaround for some metadata glitches. */
 var metadataFix = (metadata) =>   {
    // Ignore temporarily publication type
    // TODO: publicationType takes the abbreviation instead of the full string
    // used in the Reference dialog. Since KNIME runs getComponentValue twice,
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.utils.js - About 3 hrs to fix

Method handleConditions has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private String handleConditions(final Integer condId, final PmmXmlDoc misc, PmmTimeSeries ts) {
        String result = "";
        PreparedStatement ps;
        try {
            ps = conn.prepareStatement("DELETE FROM \"Versuchsbedingungen_Sonstiges\" WHERE \"Versuchsbedingungen\" = " + condId);

Function normal has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function normal(source, setState) {
    if (source.eatWhile(whiteCharRE)) {
      return null;
    }

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

Function drawSelectionRange has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function drawSelectionRange(cm, range$$1, output) {
    var display = cm.display, doc = cm.doc;
    var fragment = document.createDocumentFragment();
    var padding = paddingH(cm.display), leftSide = padding.left;
    var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/lib/codemirror.js - About 3 hrs to fix

Function create has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        create(id, title, formData, port) {
            let O = this;
            // modal body
            let form = $( '<form class="form-striped" no-immidiate-submit></form>' )
            formData.forEach(prop => {
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.editable.mt.Dialog.js - About 3 hrs to fix

Function drawSelectionRange has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function drawSelectionRange(cm, range, output) {
  var display = cm.display, doc = cm.doc
  var fragment = document.createDocumentFragment()
  var padding = paddingH(cm.display), leftSide = padding.left
  var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right

Function drawSelectionRange has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function drawSelectionRange(cm, range, output) {
  var display = cm.display, doc = cm.doc
  var fragment = document.createDocumentFragment()
  var padding = paddingH(cm.display), leftSide = padding.left
  var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right

Function generate_uniqueItems has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

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

    private ExposureModelScope retrieveScope(Sheet sheet) {

        ExposureModelScope scope = new ExposureModelScope();

        for (int numrow = this.SCOPE_PRODHAZPOP_ROW; numrow <= (this.SCOPE_PRODHAZPOP_ROW + 11); numrow++) {
de.bund.bfr.knime.fsklab.metadata.model/src/metadata/swagger/ExposureModelSheetImporter.java on lines 456..496
de.bund.bfr.knime.fsklab.metadata.model/src/metadata/swagger/RiskModelSheetImporter.java on lines 457..498

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

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

    private ExposureModelScope retrieveScope(Sheet sheet) {

        ExposureModelScope scope = new ExposureModelScope();

        for (int numrow = this.SCOPE_PRODHAZPOP_ROW; numrow <= (this.SCOPE_PRODHAZPOP_ROW + 11); numrow++) {
de.bund.bfr.knime.fsklab.metadata.model/src/metadata/swagger/ExposureModelSheetImporter.java on lines 456..496
de.bund.bfr.knime.fsklab.metadata.model/src/metadata/swagger/QraModelSheetImporter.java on lines 462..502

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

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

    private ExposureModelScope retrieveScope(Sheet sheet) {

        ExposureModelScope scope = new ExposureModelScope();

        for (int numrow = this.SCOPE_PRODHAZPOP_ROW; numrow <= (this.SCOPE_PRODHAZPOP_ROW + 11); numrow++) {
de.bund.bfr.knime.fsklab.metadata.model/src/metadata/swagger/QraModelSheetImporter.java on lines 462..502
de.bund.bfr.knime.fsklab.metadata.model/src/metadata/swagger/RiskModelSheetImporter.java on lines 457..498

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

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 ConversionUtils.java has 301 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package metadata;

import java.io.IOException;
import java.io.InputStream;
import java.util.Collections;

File ProductImpl.java has 301 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 */
package metadata.impl;

import java.util.Date;

Method performExecute has 80 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Override
    protected PortObject[] performExecute(PortObject[] inObjects,
            ExecutionContext exec) throws Exception {
        
        BufferedDataTable table = (BufferedDataTable)inObjects[0];

Method openNewWindow has 80 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public Object openNewWindow(final MyTable theNewTable, final Object value, final Object headerValue, final String mnTable, final String mnID, final MyDBForm dbForm, final JDialog owner) {
        Object result = null;
        String titel = (headerValue == null) ? theNewTable.getTablename() : (DBKernel.getLanguage().equals("en") ? "Choose " + GuiMessages.getString((String) headerValue) + "..." : headerValue + " auswählen...");
        //JDialog f = new JDialog(DBKernel.mainFrame, titel, dbForm != null);
        JDialog f = new JDialog(owner == null ? DBKernel.mainFrame : owner, titel);
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/MainFrame.java - About 3 hrs to fix

Method fillHashtable has 80 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private static LinkedHashMap<Object, String> fillHashtable(final MyTable theTable, final String startDelim, final String delimiter, final String endDelim,
            final boolean goDeeper, final boolean forceUpdate, HashSet<MyTable> alreadyUsed) {
        if (DBKernel.myDBi != null && DBKernel.myDBi.getConn() != null) return DBKernel.myDBi.fillHashtable(theTable, startDelim, delimiter, endDelim, goDeeper, forceUpdate,
                alreadyUsed);
        if (DBKernel.myDBi != null && DBKernel.myDBi.getConn() != null) {
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/DBKernel.java - About 3 hrs to fix

Method updateParamValues has 80 lines of code (exceeds 25 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<>();

Function tokenBase has 80 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function tokenBase(stream, state) {
        if (stream.eatSpace()) {
            return null;
        }

Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/vb/vb.js - About 3 hrs to fix
Severity
Category
Status
Source
Language