SiLeBAT/FSK-Lab

View on GitHub

Showing 14,752 of 14,752 total issues

Function _updateFilter has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    async _updateFilter() {
        let O = this;
        _log( 'TABLE MAIN / _updateFilter' );

        O._filtered = []; // stores all hidden/filtered rows
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.table.mt.js - About 2 hrs to fix

Function _create has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        _create(name, mandatory, helperText) {
            let O = this;
            if ( name ) {

                // formgroup
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.editable.mt.ArrayForm.js - About 2 hrs to fix

Function appendGrid has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        appendGrid: function () {
            if (!this.options.grid) {
                return;
            }

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

Function nest has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  d3.nest = function() {
    var nest = {}, keys = [], sortKeys = [], sortValues, rollup;
    function map(mapType, array, depth) {
      if (depth >= keys.length) return rollup ? rollup.call(nest, array) : sortValues ? array.sort(sortValues) : array;
      var i = -1, n = array.length, key = keys[depth++], keyValue, object, setter, valuesByKey = new d3_Map(), values;

Function _showDatepicker has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _showDatepicker: function(input) {
        input = input.target || input;
        if (input.nodeName.toLowerCase() !== "input") { // find from button/image trigger
            input = $("input", input.parentNode)[0];
        }

Function pollContent has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

ContentEditableInput.prototype.pollContent = function () {
  if (this.readDOMTimeout != null) {
    clearTimeout(this.readDOMTimeout)
    this.readDOMTimeout = null
  }

Function submitSimulation has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function submitSimulation() {

    /**
     * Validate the entered name for a new simulation.
     * - Check that the name is not used already

Function submitSimulation has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function submitSimulation() {

    /**
     * Validate the entered name for a new simulation.
     * - Check that the name is not used already

Function pollContent has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

ContentEditableInput.prototype.pollContent = function () {
  if (this.readDOMTimeout != null) {
    clearTimeout(this.readDOMTimeout)
    this.readDOMTimeout = null
  }

Function generate_enum has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

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

    public static Parameter cloneParameter(Parameter old) {
        Parameter param = new Parameter();
        param.setClassification(old.getClassification());
        param.setDataType(old.getDataType());
        param.setDescription(old.getDescription());
de.bund.bfr.knime.fsklab.metadata.model/src/metadata/SwaggerUtil.java on lines 312..332

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

    @Deprecated
    public static de.bund.bfr.metadata.swagger.Hazard convert(metadata.Hazard deprecated) {

        de.bund.bfr.metadata.swagger.Hazard hazard = new de.bund.bfr.metadata.swagger.Hazard();
        hazard.setType(deprecated.getHazardType());
de.bund.bfr.knime.fsklab.metadata.model/src/metadata/SwaggerUtil.java on lines 939..956

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 (p.getClassification() != Parameter.ClassificationEnum.OUTPUT) {
        StringBuilder script = new StringBuilder();
        script.append("#JSON_PARAMETER_OUTUT\n");
        convertParamToJsonSerializable(p.getId(), Parameter.ClassificationEnum.INPUT);
        script.append("print(toSerializable)\n"); // important to get a return from controller
de.bund.bfr.knime.fsklab.nodes/src/de/bund/bfr/knime/fsklab/nodes/PythonJsonHandler.java on lines 86..99

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

        try {
          StringBuilder script = new StringBuilder();
          script.append("#JSON_PARAMETER_OUTUT\n");
          convertParamToJsonSerializable(p.getId(), Parameter.ClassificationEnum.OUTPUT);
          script.append("print(toSerializable)"); // important to get a return from controller
de.bund.bfr.knime.fsklab.nodes/src/de/bund/bfr/knime/fsklab/nodes/PythonJsonHandler.java on lines 54..71

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

File DbIo.java has 268 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

Method equals has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

  @Override
  public boolean equals(Object obj) {
    if (this == obj)
      return true;
    if (obj == null || getClass() != obj.getClass())

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

    @Override
    public boolean eIsSet(int featureID) {
        switch (featureID) {
            case MetadataPackage.POPULATION_GROUP__POPULATION_NAME:
                return POPULATION_NAME_EDEFAULT == null ? populationName != null : !POPULATION_NAME_EDEFAULT.equals(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 equals has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }

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

  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }

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

    @Override
    public JComponent createPanel(String assignments) {
        Map<String, Map<String, String>> assignmentsMap = XmlConverter
                .xmlToObject(assignments,
                        new LinkedHashMap<String, Map<String, String>>());

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

Severity
Category
Status
Source
Language