ncbo/bioportal_web_ui

View on GitHub
app/assets/javascripts/bp_annotator.js

Summary

Maintainability
F
1 mo
Test Coverage

File bp_annotator.js has 633 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var
  bp_last_params = null,
  annotationsTable = null,
  annotator_ontologies = null;

Severity: Major
Found in app/assets/javascripts/bp_annotator.js - About 1 day to fix

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

    function get_annotations() {
      jQuery("#results_error").html("");
      jQuery("#annotator_error").html("");
    
      // Validation
    Severity: Major
    Found in app/assets/javascripts/bp_annotator.js - About 2 hrs to fix

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

      function update_annotations_table(rowsArray) {
        "use strict";
        var ontologies = {},
          classes = {},
          match_types = {},
      Severity: Major
      Found in app/assets/javascripts/bp_annotator.js - About 2 hrs to fix

        Function get_annotation_rows_from_raw has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function get_annotation_rows_from_raw(annotation, params) {
          "use strict";
          // data independent var declarations
          var
            rows = [],
        Severity: Minor
        Found in app/assets/javascripts/bp_annotator.js - About 1 hr to fix

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

          function get_annotation_rows(annotation, params) {
            "use strict";
            // data independent var declarations
            var
              rows = [],
          Severity: Minor
          Found in app/assets/javascripts/bp_annotator.js - About 1 hr to fix

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

            function get_class_details_from_raw(cls) {
              var
                ont_acronym = cls.links.ontology.replace(/.*\//, ''),
                ont_name = annotator_ontologies[cls.links.ontology].name,
                ont_rel_ui = '/ontologies/' + ont_acronym,
            Severity: Minor
            Found in app/assets/javascripts/bp_annotator.js - About 1 hr to fix

              Function display_annotations has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              function display_annotations(data, params) {
                "use strict";
                var annotations = data.annotations;
                var all_rows = [];
                if (params.raw !== undefined && params.raw === true) {
              Severity: Minor
              Found in app/assets/javascripts/bp_annotator.js - About 45 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

              Function update_annotations_table has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              function update_annotations_table(rowsArray) {
                "use strict";
                var ontologies = {},
                  classes = {},
                  match_types = {},
              Severity: Minor
              Found in app/assets/javascripts/bp_annotator.js - About 45 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

              Function get_annotations has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              function get_annotations() {
                jQuery("#results_error").html("");
                jQuery("#annotator_error").html("");
              
                // Validation
              Severity: Minor
              Found in app/assets/javascripts/bp_annotator.js - About 35 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

              function update_annotations_table(rowsArray) {
                "use strict";
                var ontologies = {},
                  classes = {},
                  match_types = {},
              Severity: Major
              Found in app/assets/javascripts/bp_annotator.js and 1 other location - About 5 days to fix
              app/assets/javascripts/bp_annotatorplus.js on lines 748..840

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

              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

              function get_annotation_rows(annotation, params) {
                "use strict";
                // data independent var declarations
                var
                  rows = [],
              Severity: Major
              Found in app/assets/javascripts/bp_annotator.js and 1 other location - About 2 days to fix
              app/assets/javascripts/bp_annotatorplus.js on lines 643..681

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

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

              var filter_classes = {
                init: function() {
                  "use strict";
                  jQuery("#filter_classes").bind("click", function(e) {
                    bp_popup_init(e)
              Severity: Major
              Found in app/assets/javascripts/bp_annotator.js and 5 other locations - About 1 day to fix
              app/assets/javascripts/bp_annotator.js on lines 292..333
              app/assets/javascripts/bp_annotator.js on lines 335..376
              app/assets/javascripts/bp_annotatorplus.js on lines 248..289
              app/assets/javascripts/bp_annotatorplus.js on lines 333..374
              app/assets/javascripts/bp_annotatorplus.js on lines 376..417

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

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

              var filter_match_type = {
                init: function() {
                  "use strict";
                  jQuery("#filter_match_type").bind("click", function(e) {
                    bp_popup_init(e)
              Severity: Major
              Found in app/assets/javascripts/bp_annotator.js and 5 other locations - About 1 day to fix
              app/assets/javascripts/bp_annotator.js on lines 207..248
              app/assets/javascripts/bp_annotator.js on lines 292..333
              app/assets/javascripts/bp_annotatorplus.js on lines 248..289
              app/assets/javascripts/bp_annotatorplus.js on lines 333..374
              app/assets/javascripts/bp_annotatorplus.js on lines 376..417

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

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

              var filter_matched_classes = {
                init: function() {
                  "use strict";
                  jQuery("#filter_matched_classes").bind("click", function(e) {
                    bp_popup_init(e)
              Severity: Major
              Found in app/assets/javascripts/bp_annotator.js and 5 other locations - About 1 day to fix
              app/assets/javascripts/bp_annotator.js on lines 207..248
              app/assets/javascripts/bp_annotator.js on lines 335..376
              app/assets/javascripts/bp_annotatorplus.js on lines 248..289
              app/assets/javascripts/bp_annotatorplus.js on lines 333..374
              app/assets/javascripts/bp_annotatorplus.js on lines 376..417

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

              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

              function createFilterCheckboxes(filter_items, checkbox_class, checkbox_location) {
                "use strict";
                var for_sort = [],
                  sorted = [];
              
              
              Severity: Major
              Found in app/assets/javascripts/bp_annotator.js and 1 other location - About 1 day to fix
              app/assets/javascripts/bp_annotatorplus.js on lines 179..204

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

              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

              var filter_matched_ontologies = {
                init: function() {
                  "use strict";
                  jQuery("#filter_matched_ontologies").bind("click", function(e) {
                    bp_popup_init(e);
              Severity: Major
              Found in app/assets/javascripts/bp_annotator.js and 3 other locations - About 1 day to fix
              app/assets/javascripts/bp_annotator.js on lines 165..205
              app/assets/javascripts/bp_annotatorplus.js on lines 206..246
              app/assets/javascripts/bp_annotatorplus.js on lines 291..331

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

              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

              var filter_ontologies = {
                init: function() {
                  "use strict";
                  jQuery("#filter_ontologies").bind("click", function(e) {
                    bp_popup_init(e)
              Severity: Major
              Found in app/assets/javascripts/bp_annotator.js and 3 other locations - About 1 day to fix
              app/assets/javascripts/bp_annotator.js on lines 250..290
              app/assets/javascripts/bp_annotatorplus.js on lines 206..246
              app/assets/javascripts/bp_annotatorplus.js on lines 291..331

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

              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

              function generateParameters() {
                "use strict";
                var params = [];
                var new_params = jQuery.extend(true, {}, bp_last_params); // deep copy
                delete new_params["apikey"];
              Severity: Major
              Found in app/assets/javascripts/bp_annotator.js and 1 other location - About 1 day to fix
              app/assets/javascripts/bp_annotatorplus.js on lines 472..494

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

              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

              function get_class_details_from_raw(cls) {
                var
                  ont_acronym = cls.links.ontology.replace(/.*\//, ''),
                  ont_name = annotator_ontologies[cls.links.ontology].name,
                  ont_rel_ui = '/ontologies/' + ont_acronym,
              Severity: Major
              Found in app/assets/javascripts/bp_annotator.js and 1 other location - About 1 day to fix
              app/assets/javascripts/bp_annotatorplus.js on lines 597..627

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

              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

              var removeFilters = function() {
                "use strict";
                jQuery(".filter_ontology_checkboxes").attr("checked", false);
                jQuery(".filter_classes_checkboxes").attr("checked", false);
                jQuery(".filter_match_type_checkboxes").attr("checked", false);
              Severity: Major
              Found in app/assets/javascripts/bp_annotator.js and 1 other location - About 7 hrs to fix
              app/assets/javascripts/bp_annotatorplus.js on lines 419..432

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

              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

              var displayFilteredColumnNames = function() {
                "use strict";
                var column_names = [];
                var header_text;
                jQuery(".bp_popup_list input:checked").closest("th").each(function() {
              Severity: Major
              Found in app/assets/javascripts/bp_annotator.js and 1 other location - About 6 hrs to fix
              app/assets/javascripts/bp_annotatorplus.js on lines 163..177

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

              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

                if (params.raw !== undefined && params.raw === true) {
                  // The annotator_controller does not 'massage' the REST data.
                  // The class prefLabel and ontology name must be resolved with ajax.
                  annotator_ontologies = data.ontologies;
                  for (var i = 0; i < annotations.length; i++) {
              Severity: Major
              Found in app/assets/javascripts/bp_annotator.js and 1 other location - About 5 hrs to fix
              app/assets/javascripts/bp_annotatorplus.js on lines 846..859

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

              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

              jQuery.fn.dataTableExt.oApi.fnSortNeutral = function(oSettings) {
                "use strict";
                /* Remove any current sorting */
                oSettings.aaSorting = [];
                /* Sort display arrays so we get them in numerical order */
              Severity: Major
              Found in app/assets/javascripts/bp_annotator.js and 1 other location - About 4 hrs to fix
              app/assets/javascripts/bp_annotatorplus.js on lines 435..448

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

              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

              function get_text_markup(text, from, to) {
                var
                  text_match = text.substring(from - 1, to),
                  // remove everything prior to the preceding three words (using space delimiters):
                  text_prefix = text.substring(0, from - 1).replace(/.* ((?:[^ ]* ){2}[^ ]*$)/, "... $1"),
              Severity: Major
              Found in app/assets/javascripts/bp_annotator.js and 1 other location - About 4 hrs to fix
              app/assets/javascripts/bp_annotatorplus.js on lines 629..641

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

              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

              function get_class_details(cls) {
                var
                  cls_rel_ui = cls.ui.replace(/^.*\/\/[^\/]+/, ''),
                  ont_rel_ui = cls_rel_ui.replace(/\?p=classes.*$/, '?p=summary');
                return class_details = {
              Severity: Major
              Found in app/assets/javascripts/bp_annotator.js and 1 other location - About 3 hrs to fix
              app/assets/javascripts/bp_annotatorplus.js on lines 584..595

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

              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

                if (jQuery("#semantic_types").val() !== null) {
                  params.semantic_types = jQuery("#semantic_types").val();
                  annotationsTable.fnSetColumnVis(BP_COLUMNS.sem_types, true);
                  jQuery("#results_error").html("Only results from ontologies with semantic types available are displayed.");
                } else {
              Severity: Major
              Found in app/assets/javascripts/bp_annotator.js and 2 other locations - About 3 hrs to fix
              app/assets/javascripts/bp_annotatorplus.js on lines 125..131
              app/assets/javascripts/bp_annotatorplus.js on lines 133..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 95.

              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 insertSampleText(event) {
                "use strict";
                event.preventDefault();
                var text = "Melanoma is a malignant tumor of melanocytes which are found predominantly in skin but also in the bowel and the eye.";
                jQuery("#annotation_text").focus();
              Severity: Minor
              Found in app/assets/javascripts/bp_annotator.js and 1 other location - About 55 mins to fix
              app/assets/javascripts/bp_annotatorplus.js on lines 34..40

              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

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

                if (jQuery("#annotation_text").val().split(' ').length > 500) {
                  jQuery("#annotator_error").html("Please use less than 500 words. If you need to annotate larger pieces of text you can use the <a href='http://www.bioontology.org/wiki/index.php/Annotator_User_Guide' target='_blank'>Annotator Web Service</a>");
                  return;
                }
              Severity: Minor
              Found in app/assets/javascripts/bp_annotator.js and 1 other location - About 50 mins to fix
              app/assets/javascripts/bp_annotatorplus.js on lines 53..56

              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

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

                jQuery("[name='mappings']:checked").each(function() {
                  mappings.push(jQuery(this).val());
                });
              Severity: Minor
              Found in app/assets/javascripts/bp_annotator.js and 1 other location - About 50 mins to fix
              app/assets/javascripts/bp_annotatorplus.js on lines 120..122

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

              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