SiLeBAT/FSK-Lab

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

Summary

Maintainability
F
5 days
Test Coverage

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

/*

version: 1.0.0
author: sascha obermüller
date: 04.12.2020
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.ui.js - About 5 hrs to fix

Function _initRangeslider has 96 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _initRangeslider ( container ) {
        let O = this;
        _log( 'UI / _initRangeslider' );

        let $elems = $( container ).length > 0 ? $( container ).find( '[data-rangeslider]' ) : $( '[data-rangeslider]' );
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.ui.js - About 3 hrs to fix

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

    _initTouchspin ( container ) {
        let O = this;
        _log( 'UI / _initTouchspin' );

        let $elems = $( container ).length > 0 ? $( container ).find( 'input[data-touchspin]' ) : $( 'input[data-touchspin]' );
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.ui.js - About 1 hr to fix

Function _initClear has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _initClear ( container ) {
        let O = this;
        _log( 'UI / _initClear' );

        let $elems = $( container ).length > 0 ? $( container ).find( '[data-clear]' ) : $( '[data-clear]' );
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.ui.js - About 1 hr to fix

Function _initSelect2 has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _initSelect2 ( container ) {
        let O = this;
        _log( 'UI / _initSelect2' );

        let $elems = $( container ).length > 0 ? $( container ).find( 'select[data-sel2]' ) : $( 'select[data-sel2]' );
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.ui.js - About 1 hr to fix

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

                if( el.hasAttribute( 'data-control-double-from' ) && $( $el.data( 'control-double-from' ) ).length > 0 ) {
                    $el.$inputDoubleFrom = $( $el.data( 'control-double-from' ) );
                    $el.$inputDoubleFrom.on( 'change', ( event ) => {
                        let min = $el.data( 'rangeslider' ).result.min;
                        let to = $el.data( 'rangeslider' ).result.to;
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.ui.js and 1 other location - About 1 day to fix
de.bund.bfr.knime.js/src/js/app/app.ui.js on lines 504..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 234.

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( el.hasAttribute( 'data-control-double-to' ) && $( $el.data( 'control-double-to' ) ).length > 0 ) {
                    $el.$inputDoubleTo = $( $el.data( 'control-double-to' ) );
                    $el.$inputDoubleTo.on( 'change', ( event ) => {
                        let max = $el.data( 'rangeslider' ).result.max;
                        let from = $el.data( 'rangeslider' ).result.from;
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.ui.js and 1 other location - About 1 day to fix
de.bund.bfr.knime.js/src/js/app/app.ui.js on lines 482..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 234.

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

                    rangesliderDefaults = $.merge( {
                        drag_interval    : false,
                        onStart            : ( data ) => { $el.updateInputs( data ); },
                        onChange        : ( data ) => { $el.updateInputs( data ); },
                        onFinish        : ( data ) => { $el.updateInputs( data ); }
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.ui.js and 1 other location - About 2 hrs to fix
de.bund.bfr.knime.js/src/js/app/app.ui.js on lines 571..576

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

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

                    rangesliderDefaults = $.merge( {
                        drag_interval    : false,
                        onStart            : ( data ) => { $el.updateInputs( data ); },
                        onChange        : ( data ) => { $el.updateInputs( data ); },
                        onFinish        : ( data ) => { $el.updateInputs( data ); }
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.ui.js and 1 other location - About 2 hrs to fix
de.bund.bfr.knime.js/src/js/app/app.ui.js on lines 527..532

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

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

                        col.classes && col.classes.th ? $th.addClass( col.classes.th ) : null; // classes
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.ui.js and 1 other location - About 30 mins to fix
de.bund.bfr.knime.js/src/js/app/app.table.js on lines 316..316

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