SiLeBAT/FSK-Lab

View on GitHub

Showing 6,856 of 14,752 total issues

Function addRow has 94 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    addRow( rowIndex, rowData, tableData, isMainTable, isEdit) {
        
        let O = this;
        tableData = O._tableData
        // row
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.table.js - About 3 hrs to fix

Function keydown has 94 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        keydown: function(e){
            if (!this.picker.is(':visible')){
                if (e.keyCode === 40 || e.keyCode === 27) { // allow down to re-show picker
                    this.show();
                    e.stopPropagation();
Severity: Major
Found in de.bund.bfr.knime.js/src/js/lib/bootstrap-datepicker.js - About 3 hrs to fix

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

File FskService.java has 323 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package de.bund.bfr.knime.fsklab.service;

import static spark.Spark.awaitInitialization;
import static spark.Spark.before;
import static spark.Spark.get;

Method setValue has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    private void setValue(Object o, String fieldName, Object oldValue, Object newValue) {
        // todo: checken, ob "oldValue = oldValue"?
        try {
            if (fieldName.indexOf("#") >= 0) { // z.B. '#parameter#elementSet/2'
                String fn = fieldName.substring(0, fieldName.indexOf("#"));// "parameter"

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

    public static boolean passesFilter(final String literatureString, final Integer literatureID, final KnimeTuple tuple) throws PmmException {
        if (literatureString == null || literatureString.trim().isEmpty()) return true;
            PmmXmlDoc litXmlDoc = tuple.getPmmXml(TimeSeriesSchema.ATT_LITMD);
            for (PmmXmlElementConvertable el : litXmlDoc.getElementSet()) {
                if (el instanceof LiteratureItem) {

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

    private Date manageDate(PreparedStatement ps, PreparedStatement psUpdate, int lfdCol, HSSFCell cell) throws SQLException {
        Date result = null;
        if (cell == null || cell.getCellType() == HSSFCell.CELL_TYPE_BLANK) {
        } else if (cell.getCellType() == HSSFCell.CELL_TYPE_STRING) {
            if (cell.getStringCellValue().trim().length() > 0) {
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/imports/GeneralXLSImporter.java - About 3 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 getCharge_Lieferung has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    private Integer[] getCharge_Lieferung(String id, String name, String street, String streetNumber, String zip, String city, String county, String country, String kind,
            String vat, String article, String articleNumber, String prodTreatment, String charge, String dayMHD, String monthMHD, String yearMHD, String dayP, String monthP,
            String yearP, String originCountry, String dayD, String monthD, String yearD, String amountKG, String typePU, String numPU, String idTo, String nameTo,
            String streetTo, String streetNumberTo, String zipTo, String cityTo, String countyTo, String countryTo, String kindTo, String vatTo, String serial, String cqr,
            String EndChain, String Explanation_EndChain, String Further_Traceback, String MicrobiologicalSample) {

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

    private Double getValueX(String paramX, String paramY, String unitX,
            String unitY, String transformX, String transformY, Double y,
            double minX, double maxX, Double minY, Double maxY, DJep parser,
            Node f) {
        if (y == 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 addMiscs has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    public void addMiscs(final PmmXmlDoc misc) throws PmmException {
        PmmXmlDoc miscXmlDoc = getMisc();
        if (miscXmlDoc == null) {
            setValue(TimeSeriesSchema.ATT_MISC, misc);            
        }

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

    public boolean isPlotable() {
        if (type == FUNCTION || type == FUNCTION_SAMPLE) {
            for (String param : functionParameters.keySet()) {
                if (functionParameters.get(param) == null) {
                    return 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 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;
        

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

    private void handleParams() {
        DoubleTextField[] dtf;
        if (params == null || params.size() == 0) {
            params = new LinkedHashMap<>();
            dtf = new DoubleTextField[2]; dtf[0] = new DoubleTextField(true); dtf[1] = new DoubleTextField(true);

Function to_explicit has 93 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function to_explicit(stream, state) {
    var token = null;

    if (phase(state) == rx_substitution ||
        stream.match(rx_substitution, false)) {
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/rst/rst.js - About 3 hrs to fix

Function _process_options has 93 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        _process_options: function(opts){
            // Store raw options for reference
            this._o = $.extend({}, this._o, opts);
            // Processed options
            var o = this.o = $.extend({}, this._o);
Severity: Major
Found in de.bund.bfr.knime.js/src/js/lib/bootstrap-datepicker.js - About 3 hrs to fix

Function editable has 93 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.fn.editable = function (option) {
        //special API methods returning non-jquery object
        var result = {}, args = arguments, datakey = 'editable';
        switch (option) {
            /**

Function init has 93 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    modelPlotter.init = function(representation, value) {
        //alert(JSON.stringify(representation));
        plotterValue = value;
        plotterRep = representation;
        

Function createAtomic has 93 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function createAtomic(x, y, width, height, modelName, inputs, outputs, modelIndex,simulations) {
    let simulationoption = ``;
    let disabled = 'disabled="disabled"';
    let nothing = '';
    simulations.forEach(sim => {

Method step has 92 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private PmmTimeSeries step(BufferedReader reader) throws IOException {
        // initialize next time series
        PmmTimeSeries next = new PmmTimeSeries();

        while (true) {

File PrimaryJoiner.java has 320 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