SiLeBAT/FSK-Lab

View on GitHub
de.bund.bfr.knime.js/src/js/app/app.simulation.js

Summary

Maintainability
F
1 wk
Test Coverage

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

/*

version: 1.0.0
author: Ahmad Swaid
date: 17.12.2020
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js - About 1 day to fix

Function _createFormField has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring.
Open

    _createFormField ( param ) {
        let O = this;
        _log( 'PANEL SIM / _createFormField' );
        _log( param );

Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js - About 1 day 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

Function _createFormField has 157 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _createFormField ( param ) {
        let O = this;
        _log( 'PANEL SIM / _createFormField' );
        _log( param );

Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js - About 6 hrs to fix

Function _validateSimField has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
Open

    _validateSimField ( field ) {
        let O = this;
        _log( 'PANEL SIM / _validateSimField' );
        _log( field );

Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js - About 6 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

APPSimulation has 26 functions (exceeds 20 allowed). Consider refactoring.
Open

class APPSimulation {
    constructor ( settings, $container ) {
        let O = this;
        // defaults maintable simulations modal
        O._$container = $container;
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js - About 3 hrs to fix

Function _validateSimField has 67 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _validateSimField ( field ) {
        let O = this;
        _log( 'PANEL SIM / _validateSimField' );
        _log( field );

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

Function _populateSimForm has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _populateSimForm () {
        let O = this;
        _log( 'PANEL SIM / _populateSimForm' );

        // clear
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js - About 2 hrs to fix

Function _updateSimForm has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _updateSimForm ( simIndex ) {
        let O = this;
        _log( 'PANEL SIM / _updateSimForm: '+ simIndex );

        simIndex = ! _isNull( simIndex ) ? simIndex : O._simSelectedIndex;
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js - About 2 hrs to fix

Function _createSimActions has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _createSimActions() {
        let O = this;
        _log( 'panel SIM / _createSimActions' );

        // sim select actions
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js - About 1 hr to fix

Function _runModelView has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    async _runModelView ( modelId ) {
        let O = this;
        _log( 'PANEL SIM / _runModelView : '+ O._modelId, 'secondary' );

        modelId = modelId || O._modelId;
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js - About 1 hr to fix

Function _createSimulationContent has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _createSimulationContent () {
        let O = this;
        _log( 'panel SIM / _createSimulationContent' );

        // nav
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js - About 1 hr to fix

Function _createParamMetadataList has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _createParamMetadataList( param ) {
        let O = this;
        _log( 'PANEL SIM / _createParamMetadataList' );

        let listData = {
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js - About 1 hr to fix

Avoid deeply nested control flow statements.
Open

                        if ( param.dataType.toLowerCase() === 'double' ) {
                            let decimals = param.value.substring( param.value.indexOf( '.' ) + 1 ).length;
                            for ( let j = 0; j < decimals; j++ ) {
                                step = step / 10;
                            }
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        if ( param.unit && param.unit != '[]' && param.unit != 'Others' ) {
                            let $append = $( '<div class="input-group-text"></div>' )
                                .text( param.unit )
                                .insertAfter( $inputControl )
                                .wrap( '<div class="input-group-append"></div>' )
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        if ( param.dataType.toLowerCase() === 'double' ) {
                            let decimals = param.value.substring(param.value.indexOf('.') + 1).length;
                            for ( let j = 0; j < decimals; j++ ) {
                                step = step / 10;
                            }
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                    if ( field.param.minValue && parseFloat( field.param.minValue ) > fieldValue ) {
                        return {
                            input      : field.input,
                            msg     : 'Invalid value. Value is lower than minimal value: '+ field.param.minValue
                        };
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                    if ( field.param.maxValue && parseFloat( field.param.maxValue ) < fieldValue ) {
                        return {
                            input      : field.input,
                            msg     : 'Invalid value. Value is higher than maximum value: '+ field.param.maxValue
                        };
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        if ( param.unit && param.unit != '[]' && param.unit != 'Others' ) {
                            $input.attr( 'data-touchspin-postfix', param.unit );
                        }
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                else if ( field.param.dataType.toLowerCase() === 'file' ) {

                    // TBD

                }
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                    if ( field.param.dataType.toLowerCase === 'integer' && fieldValue.indexOf('.') > 0 ){
                        return {
                                input   : field.input,
                                msg     : 'Invalid integer value'
                            };
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js - About 45 mins to fix

Avoid too many return statements within this function.
Open

                        return {
                            input      : field.input,
                            msg     : 'Invalid value. Value is higher than maximum value: '+ field.param.maxValue
                        };
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

                        return {
                                input   : field.input,
                                msg     : 'Invalid integer value'
                            };
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return false;
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

                        return {
                            input      : field.input,
                            msg     : 'Invalid value. Value is lower than minimal value: '+ field.param.minValue
                        };
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js - About 30 mins to fix

Function _saveSimulation has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    async _saveSimulation () {
        let O = this;
        _log( 'PANEL SIM / _saveSimulation', 'secondary' );

        if(O._$simNameInput.val() == ""){
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js - About 25 mins 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

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

    _updateSimName() {
        let O = this;
        _log( 'PANEL SIM / _updateSimName' );

        if( O._$simNameInput ) {
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js and 1 other location - About 4 hrs to fix
de.bund.bfr.knime.js/src/js/app/app.simulation.js on lines 759..774

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

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

    _updateSimDescription( $input ) {
        let O = this;
        _log( 'PANEL SIM / _updateSimDescription' );

        if( O._$simDescInput ) {
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js and 1 other location - About 4 hrs to fix
de.bund.bfr.knime.js/src/js/app/app.simulation.js on lines 735..750

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

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

    constructor ( settings, $container ) {
        let O = this;
        // defaults maintable simulations modal
        O._$container = $container;
        O._opts = $.extend( true, {}, {
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js and 2 other locations - About 4 hrs to fix
de.bund.bfr.knime.js/src/js/app/app.editable.mt.details.js on lines 10..26
de.bund.bfr.knime.js/src/js/app/app.mt.details.js on lines 10..26

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

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

        O._$simActionAdd = $( '<button type="button" class="btn btn-icon btn-outline-light ml-1"><i class="feather icon-plus"></i></button>' )
            .attr( 'id', 'simActionAdd' )
            .attr( 'data-tooltip', '' )
            .attr( 'title', 'Add simulation' )
            .appendTo( $actionGroup1 )
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js and 2 other locations - About 2 hrs to fix
de.bund.bfr.knime.js/src/js/app/app.simulation.js on lines 126..133
de.bund.bfr.knime.js/src/js/app/app.simulation.js on lines 146..153

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

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

        O._$simActionSave = $( '<button type="button" class="btn btn-icon btn-outline-light ml-1"><i class="feather icon-save"></i></button>' )
            .attr( 'id', 'simActionSave' )
            .attr( 'data-tooltip', '' )
            .attr( 'title', 'Save changes' )
            .appendTo( $actionGroup1 )
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js and 2 other locations - About 2 hrs to fix
de.bund.bfr.knime.js/src/js/app/app.simulation.js on lines 126..133
de.bund.bfr.knime.js/src/js/app/app.simulation.js on lines 136..143

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

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

        O._$simActionRemove = $( '<button type="button" class="btn btn-icon btn-outline-light"><i class="feather icon-trash-2"></i></button>' )
            .attr( 'id', 'simActionRemove' )
            .attr( 'data-tooltip', '' )
            .attr( 'title', 'Remove simulation' )
            .appendTo( $actionGroup1 )
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js and 2 other locations - About 2 hrs to fix
de.bund.bfr.knime.js/src/js/app/app.simulation.js on lines 136..143
de.bund.bfr.knime.js/src/js/app/app.simulation.js on lines 146..153

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

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 ( field.param.minValue && parseFloat( field.param.minValue ) > fieldValue ) {
                        return {
                            input      : field.input,
                            msg     : 'Invalid value. Value is lower than minimal value: '+ field.param.minValue
                        };
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js and 1 other location - About 1 hr to fix
de.bund.bfr.knime.js/src/js/app/app.simulation.js on lines 993..998

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

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 ( field.param.maxValue && parseFloat( field.param.maxValue ) < fieldValue ) {
                        return {
                            input      : field.input,
                            msg     : 'Invalid value. Value is higher than maximum value: '+ field.param.maxValue
                        };
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js and 1 other location - About 1 hr to fix
de.bund.bfr.knime.js/src/js/app/app.simulation.js on lines 987..992

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

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

        let simDescParam = {
            id                 : 'simDescription',
            dataType         : 'SIMDESCRIPTION',
            _showMetadata     : false,
            _label             : 'Description (optional)',
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js and 1 other location - About 1 hr to fix
de.bund.bfr.knime.js/src/js/app/app.simulation.js on lines 513..524

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

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

        let simNameParam = {
            id                 : 'simName',
            dataType         : 'SIMNAME',
            _showMetadata     : false,
            _label             : 'Simulation Name',
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js and 1 other location - About 1 hr to fix
de.bund.bfr.knime.js/src/js/app/app.simulation.js on lines 529..540

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

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

                else if ( inputType == 'simName' ) {
                    $input = $( '<input type="text" class="form-control form-control-sm" />' )
                        .attr( 'id', 'customInput_'+ param.id )
                        .data( 'custom-input', param )
                        .appendTo( $field );
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js and 1 other location - About 1 hr to fix
de.bund.bfr.knime.js/src/js/app/app.simulation.js on lines 412..426

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

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

                else if ( inputType == 'simDescription' ) {
                    $input = $( '<textarea type="text" class="form-control form-control-sm" rows="6" /></textarea>' )
                        .attr( 'id', 'customInput_'+ param.id )
                        .data( 'custom-input', param ) 
                        .appendTo( $field );
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js and 1 other location - About 1 hr to fix
de.bund.bfr.knime.js/src/js/app/app.simulation.js on lines 403..426

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

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 ( simIndex == -1 ) { // add simulation
            O._$simActionRemove.prop( 'disabled', false );
            O._$simActionAdd.prop( 'disabled', true );
            O._$simActionSave.prop( 'disabled', false );
        }
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js and 1 other location - About 55 mins to fix
de.bund.bfr.knime.js/src/js/app/app.simulation.js on lines 717..726

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

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

        else if ( simIndex == 0 ) { // default sim
            O._$simActionRemove.prop( 'disabled', true );
            O._$simActionAdd.prop( 'disabled', false );
            O._$simActionSave.prop( 'disabled', true );
        }
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js and 1 other location - About 55 mins to fix
de.bund.bfr.knime.js/src/js/app/app.simulation.js on lines 712..726

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

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( state == 'execution' ) {
                O._$modalExecution.show();
                O._$modalParams.hide();
                O._$modalNav.hide();
            }
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js and 1 other location - About 30 mins to fix
de.bund.bfr.knime.js/src/js/app/app.simulation.js on lines 1156..1160

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

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

            else {
                O._$modalExecution.hide();
                O._$modalParams.show();
                O._$modalNav.show();
            }
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.simulation.js and 1 other location - About 30 mins to fix
de.bund.bfr.knime.js/src/js/app/app.simulation.js on lines 1151..1155

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

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

There are no issues that match your filters.

Category
Status