SiLeBAT/FSK-Lab

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

Summary

Maintainability
D
2 days
Test Coverage

Function _createComplexPanel has 113 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        _createComplexPanel(data, formData, title, dialog) {
            let O = this;

            // tab-pane
            let $panel = $('<div class="tab-pane h-100" role="tabpanel"></div>')
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.editable.mt.TablePanel.js - About 4 hrs to fix

Function edit has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

        edit(index, originalData, dialog) {
            let O = this;
            let keys = [];
            $.each(O.panelTable.opts.cols,function(index,key){
                keys.push(key.field);
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.editable.mt.TablePanel.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 edit has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        edit(index, originalData, dialog) {
            let O = this;
            let keys = [];
            $.each(O.panelTable.opts.cols,function(index,key){
                keys.push(key.field);
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.editable.mt.TablePanel.js - About 1 hr to fix

Avoid deeply nested control flow statements.
Open

                        if(dialog.inputs[keys[indexx]].input.trigger){
                            dialog.inputs[keys[indexx]].input.trigger('change');
                        }
Severity: Major
Found in de.bund.bfr.knime.js/src/js/app/app.editable.mt.TablePanel.js - About 45 mins to fix

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

                        {
                            type             : 'link',
                            idPrefix         : 'mtActionMerge_',
                            icon            : 'icon-arrow-down',
                            title             : 'Move down',
de.bund.bfr.knime.js/src/js/app/app.editable.mt.TablePanel.js on lines 102..117

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

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

                        {
                            type             : 'link',
                            idPrefix         : 'mtActionMerge_',
                            icon            : 'icon-arrow-up',
                            title             : 'Move Up',
de.bund.bfr.knime.js/src/js/app/app.editable.mt.TablePanel.js on lines 118..133

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

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

            $.each($(O.panelTable._$tbody).find('tr'),function(rowindex, row){
                $(row).attr('data-row-id',rowindex);
            });
de.bund.bfr.knime.js/src/js/app/app.editable.mt.TablePanel.js on lines 282..284

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

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

            $.each($(O.panelTable._$tbody).find('tr'),function(rowindex, row){
                $(row).attr('data-row-id',rowindex);
            });
de.bund.bfr.knime.js/src/js/app/app.editable.mt.TablePanel.js on lines 297..299

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

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

                $.each(formData, (i, prop) => {
                    tableSettings.cols.push(
                        {
                            label: prop.label,
                            field: prop.id,
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.editable.mt.TablePanel.js and 1 other location - About 50 mins to fix
de.bund.bfr.knime.js/src/js/app/app.mt.details.js on lines 437..446

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

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

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

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

            $.each(O.panelTable.opts.cols,function(index,key){
                keys.push(key.field);
            })
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.editable.mt.TablePanel.js and 1 other location - About 30 mins to fix
de.bund.bfr.knime.js/src/js/app/app.editable.mt.TablePanel.js on lines 208..210

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

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

            $.each(O.panelTable.opts.cols,function(index,key){
                keys.push(key.field);
            })
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.editable.mt.TablePanel.js and 1 other location - About 30 mins to fix
de.bund.bfr.knime.js/src/js/app/app.editable.mt.TablePanel.js on lines 235..237

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