SiLeBAT/FSK-Lab

View on GitHub
de.bund.bfr.knime.js/src/js/app/app.editable.mt.InputForm.js

Summary

Maintainability
D
2 days
Test Coverage

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

        _createFormField ( name, mandatory, type, helperText, value, vocabulary, port ) {
            let O = this;
            _log( 'PANEL SIM / _createFormField' );
            _log( name );

Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.editable.mt.InputForm.js - About 4 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

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

        _createFormField ( name, mandatory, type, helperText, value, vocabulary, port ) {
            let O = this;
            _log( 'PANEL SIM / _createFormField' );
            _log( name );

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

Function validate has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

        validate() {
            let O = this;
            _log( 'PANEL  / _validateForm' );
           
            let validationErrors = [];
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.editable.mt.InputForm.js - About 1 hr 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 value has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

        get value() {
            let O = this;
            if (O.type === "date") {
                if(O.input.val()){
                    value = O.input.val().split("-");
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.editable.mt.InputForm.js - About 1 hr 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 validate has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        validate() {
            let O = this;
            _log( 'PANEL  / _validateForm' );
           
            let validationErrors = [];
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.editable.mt.InputForm.js - About 1 hr to fix

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

                if (helperText) {
                    // action metadata list
                    let $actionMetadata = $( '<button class="action action-pure float-right" type="button"><i class="feather icon-info"></i></button>' )
                        .attr( 'data-toggle', 'collapse' )
                        .attr( 'data-target', '#metadata_'+ name.replace(/[\W_]+/g,"_") )
de.bund.bfr.knime.js/src/js/app/app.editable.mt.SelectForm.js on lines 53..62
de.bund.bfr.knime.js/src/js/app/app.editable.mt.TextareaForm.js on lines 57..66

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

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

                if (helperText) {
                    // metadata table
                    let $metadataContainer = $( '<div class="collapse param-metadata"></div>' )
                        .attr( 'id', 'metadata_'+ name.replace(/[\W_]+/g,"_") )
                        .attr( 'aria-expanded', false )
de.bund.bfr.knime.js/src/js/app/app.editable.mt.ArrayForm.js on lines 118..126
de.bund.bfr.knime.js/src/js/app/app.editable.mt.SelectForm.js on lines 106..114
de.bund.bfr.knime.js/src/js/app/app.editable.mt.TextareaForm.js on lines 78..86

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

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.input = $( '<input type="text" class="form-control form-control-sm" />' )
                            .attr( 'id', 'input_'+ name.replace(/[\W_]+/g,"_") )
                            .appendTo( $field );
                    }
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.editable.mt.InputForm.js and 1 other location - About 35 mins to fix
de.bund.bfr.knime.js/src/js/app/app.editable.mt.InputForm.js on lines 134..139

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

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 ( type == 'checkbox' ) {
                        O.input = $( '<input type="checkbox" class="form-check-input" style="width: auto;" />' )
                            .attr( 'id', 'input_'+ name.replace(/[\W_]+/g,"_") )
                            .appendTo( $field );

Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.editable.mt.InputForm.js and 1 other location - About 35 mins to fix
de.bund.bfr.knime.js/src/js/app/app.editable.mt.InputForm.js on lines 141..145

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

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

                    let month = ("" + value[1]).length > 1 ? ("" + value[1]) : ("0" + value[1]);
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.editable.mt.InputForm.js and 9 other locations - About 30 mins to fix
de.bund.bfr.knime.js/js-lib/bfr/fskutil_1.0.0.js on lines 355..355
de.bund.bfr.knime.js/js-lib/bfr/fskutil_1.0.0.js on lines 356..356
de.bund.bfr.knime.js/src/js/app/app.editable.mt.InputForm.js on lines 161..161
de.bund.bfr.knime.js/src/js/app/app.editable.mt.InputForm.js on lines 201..201
de.bund.bfr.knime.js/src/js/app/app.editable.mt.InputForm.js on lines 202..202
de.bund.bfr.knime.js/src/js/app/app.editable.mt.SimpleTable.js on lines 56..56
de.bund.bfr.knime.js/src/js/app/app.editable.mt.SimpleTable.js on lines 57..57
de.bund.bfr.knime.js/src/js/app/app.editable.mt.TablePanel.js on lines 244..244
de.bund.bfr.knime.js/src/js/app/app.editable.mt.TablePanel.js on lines 245..245

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

                    let day = ("" + value[2]).length > 1 ? ("" + value[2]) : ("0" + value[2]);
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.editable.mt.InputForm.js and 9 other locations - About 30 mins to fix
de.bund.bfr.knime.js/js-lib/bfr/fskutil_1.0.0.js on lines 355..355
de.bund.bfr.knime.js/js-lib/bfr/fskutil_1.0.0.js on lines 356..356
de.bund.bfr.knime.js/src/js/app/app.editable.mt.InputForm.js on lines 161..161
de.bund.bfr.knime.js/src/js/app/app.editable.mt.InputForm.js on lines 162..162
de.bund.bfr.knime.js/src/js/app/app.editable.mt.InputForm.js on lines 202..202
de.bund.bfr.knime.js/src/js/app/app.editable.mt.SimpleTable.js on lines 56..56
de.bund.bfr.knime.js/src/js/app/app.editable.mt.SimpleTable.js on lines 57..57
de.bund.bfr.knime.js/src/js/app/app.editable.mt.TablePanel.js on lines 244..244
de.bund.bfr.knime.js/src/js/app/app.editable.mt.TablePanel.js on lines 245..245

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

                    let month = ("" + value[1]).length > 1 ? ("" + value[1]) : ("0" + value[1]);
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.editable.mt.InputForm.js and 9 other locations - About 30 mins to fix
de.bund.bfr.knime.js/js-lib/bfr/fskutil_1.0.0.js on lines 355..355
de.bund.bfr.knime.js/js-lib/bfr/fskutil_1.0.0.js on lines 356..356
de.bund.bfr.knime.js/src/js/app/app.editable.mt.InputForm.js on lines 161..161
de.bund.bfr.knime.js/src/js/app/app.editable.mt.InputForm.js on lines 162..162
de.bund.bfr.knime.js/src/js/app/app.editable.mt.InputForm.js on lines 201..201
de.bund.bfr.knime.js/src/js/app/app.editable.mt.SimpleTable.js on lines 56..56
de.bund.bfr.knime.js/src/js/app/app.editable.mt.SimpleTable.js on lines 57..57
de.bund.bfr.knime.js/src/js/app/app.editable.mt.TablePanel.js on lines 244..244
de.bund.bfr.knime.js/src/js/app/app.editable.mt.TablePanel.js on lines 245..245

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

                    let day = ("" + value[2]).length > 1 ? ("" + value[2]) : ("0" + value[2]);
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.editable.mt.InputForm.js and 9 other locations - About 30 mins to fix
de.bund.bfr.knime.js/js-lib/bfr/fskutil_1.0.0.js on lines 355..355
de.bund.bfr.knime.js/js-lib/bfr/fskutil_1.0.0.js on lines 356..356
de.bund.bfr.knime.js/src/js/app/app.editable.mt.InputForm.js on lines 162..162
de.bund.bfr.knime.js/src/js/app/app.editable.mt.InputForm.js on lines 201..201
de.bund.bfr.knime.js/src/js/app/app.editable.mt.InputForm.js on lines 202..202
de.bund.bfr.knime.js/src/js/app/app.editable.mt.SimpleTable.js on lines 56..56
de.bund.bfr.knime.js/src/js/app/app.editable.mt.SimpleTable.js on lines 57..57
de.bund.bfr.knime.js/src/js/app/app.editable.mt.TablePanel.js on lines 244..244
de.bund.bfr.knime.js/src/js/app/app.editable.mt.TablePanel.js on lines 245..245

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