SiLeBAT/FSK-Lab

View on GitHub
de.bund.bfr.knime.pmm.nodes/js-src/de/bund/bfr/knime/pmm/editor/editor.js

Summary

Maintainability
F
2 wks
Test Coverage

File editor.js has 842 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// For debug purposes
function printKeys(object) {
    for (var key in object) { alert(key); }
}

Function insert_formula has 90 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function insert_formula(modelNumber) {

        function load_category_combo(selected_category) {
            var MODEL_CLASSES = ["unknown", "growth", "inactivation", "survival",
                "growth/inactivation", "inactivation/survival", "growth/survival",

Function save_parameters has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function save_parameters(model_number) {
        var model = models[model_number];
        model.indeps.indeps = Array();  // independent parameters
        model.params.params = Array();  // constant parameters

Function insert_model has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function insert_model(modelNumber) {
        $("#titleModel").html("Primary model info");

        var estModel = models[modelNumber].estModel;

Function change_parameters has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function change_parameters(name) {
        $("#formula, #boundary_conditions").change(function() {
            if($("#formula").val() === ''){
                $("#formula").val($("#formula").data('value'));
                $("#boundary_conditions").val($("#boundary_conditions").data('value'));

Function insert_references has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function insert_references(modelNumber) {

        function add_reference(reference_id, reference_title) {
            var row = '<tr data-id="'+ reference_id + '">' +
                      '  <td><input type="checkbox"></td>' +

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

    function load_block() {

        $(".clickable").click(function(){ 

            $(".pencil").removeClass('pencil-active');

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

    function add_constant_parameter(param) {
        var condition_attribute = ' data-status="1" ';
        var class_attribute = ' class="col-sm-1 item-first some-remove" ';

        var editable = ' class="textEdit editable editable-click" '; 

Function save_model has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function save_model(modelNumber) {
        function create_measure_error_msg(measure_name) {
            return "Goodness of Fitness (" + measure_name + "): Not a number";
        }

Function create_accordion has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function create_accordion() {
        var accordion = '';

        for (var numModel = 0; numModel < models.length; numModel++) {

Function add_independent_parameter has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function add_independent_parameter(indep) {
        var class_cell = '<td></td>';
        var name_cell = '<td>' + indep.name + '</td>';

        var indep_unit = indep.unit ? indep.unit : '';

Function add_dep_parameter has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function add_dep_parameter(dep) {
        var class_cell = '<td></td>';
        var name_cell = '<td>' + dep.name + '</td>';

        var dep_unit = dep.unit ? dep.unit : '';

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

    function add_independent_parameter(indep) {
        var class_cell = '<td></td>';
        var name_cell = '<td>' + indep.name + '</td>';

        var indep_unit = indep.unit ? indep.unit : '';
de.bund.bfr.knime.pmm.nodes/js-src/de/bund/bfr/knime/pmm/editor/editor.js on lines 517..552

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

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

    function add_dep_parameter(dep) {
        var class_cell = '<td></td>';
        var name_cell = '<td>' + dep.name + '</td>';

        var dep_unit = dep.unit ? dep.unit : '';
de.bund.bfr.knime.pmm.nodes/js-src/de/bund/bfr/knime/pmm/editor/editor.js on lines 554..588

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

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

            function row2Indep(row) {
                var unit_cell = row.find("td:eq(2) a");
                var min_cell = row.find("td:eq(6) a");
                var max_cell = row.find("td:eq(7) a");
                var desc_cell = row.find("td:eq(8) a");    
de.bund.bfr.knime.pmm.nodes/js-src/de/bund/bfr/knime/pmm/editor/editor.js on lines 933..951

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

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

            function row2Dep(row) {

                var unit_cell = row.find("td:eq(2) a");
                var min_cell = row.find("td:eq(6) a");
                var max_cell = row.find("td:eq(7) a");
de.bund.bfr.knime.pmm.nodes/js-src/de/bund/bfr/knime/pmm/editor/editor.js on lines 953..970

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

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

    function save_organism(modelNumber) {
        var organism_id = parseInt($('#ddlOrganism').val());
        var organism_name = '';
        var organism_detail = '';
        var organism_dbuuid = '';
de.bund.bfr.knime.pmm.nodes/js-src/de/bund/bfr/knime/pmm/editor/editor.js on lines 402..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 230.

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

    function save_matrix(modelNumber) {

        var matrix_id = parseInt($('#ddlMatrix').val());
        var matrix_name = '';
        var matrix_detail = '';
de.bund.bfr.knime.pmm.nodes/js-src/de/bund/bfr/knime/pmm/editor/editor.js on lines 344..367

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

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

        function load_organism_combo(selected_organism_id) {
            var list = '';
            for (var i = 0; i < dbAgents.length; i++) {
                var organism = dbAgents[i];
                var selected = (organism.id === selected_organism_id) ? "selected" : "";
de.bund.bfr.knime.pmm.nodes/js-src/de/bund/bfr/knime/pmm/editor/editor.js on lines 372..381

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

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

        function load_matrix_combo(selected_matrix_id) {
            var list = '';
            for (var i = 0; i < dbMatrices.length; i++) {
                var matrix = dbMatrices[i];
                var selected = (matrix.id === selected_matrix_id) ? "selected" : "";
de.bund.bfr.knime.pmm.nodes/js-src/de/bund/bfr/knime/pmm/editor/editor.js on lines 315..324

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

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($("#formula").val() === ''){
                $("#formula").val($("#formula").data('value'));
                $("#boundary_conditions").val($("#boundary_conditions").data('value'));
                print_error("error", "Incorrect Formula 1", "Error!");
                return;
de.bund.bfr.knime.pmm.nodes/js-src/de/bund/bfr/knime/pmm/editor/editor.js on lines 832..837

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

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

            } catch(err) {
                $("#formula").val($("#formula").data('value'));
                $("#boundary_conditions").val($("#boundary_conditions").data('value'));
                print_error("error", "Incorrect Formula 2", "Error!");
                return;
de.bund.bfr.knime.pmm.nodes/js-src/de/bund/bfr/knime/pmm/editor/editor.js on lines 816..821

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

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

            switch (moduleType) {
                case "model":
                    insert_model(modelNumber);
                    break;
                case "organism":
de.bund.bfr.knime.pmm.nodes/js-src/de/bund/bfr/knime/pmm/editor/editor.js on lines 181..199

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

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

        switch (moduleType) {
            case "model":
                save_model(modelNumber);
                break;
            case "organism":
de.bund.bfr.knime.pmm.nodes/js-src/de/bund/bfr/knime/pmm/editor/editor.js on lines 148..166

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

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