ncbo/bioportal_web_ui

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

Summary

Maintainability
F
1 mo
Test Coverage

File bp_annotatorplus.js has 717 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_annotatorplus.js - About 1 day to fix

    Function get_annotations has 92 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_annotatorplus.js - About 3 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_annotatorplus.js - About 2 hrs to fix

        Function get_annotations has a Cognitive Complexity of 17 (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_annotatorplus.js - About 2 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 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_annotatorplus.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_annotatorplus.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_annotatorplus.js - About 1 hr to fix

              Function display_annotations has 26 lines of code (exceeds 25 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_annotatorplus.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_annotatorplus.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_annotatorplus.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

                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_annotatorplus.js and 1 other location - About 5 days to fix
                app/assets/javascripts/bp_annotator.js on lines 646..738

                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_annotatorplus.js and 1 other location - About 2 days to fix
                app/assets/javascripts/bp_annotator.js on lines 560..598

                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_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_annotatorplus.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_annotator.js on lines 335..376
                app/assets/javascripts/bp_annotatorplus.js on lines 248..289
                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_annotatorplus.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_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

                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_classes = {
                  init: function() {
                    "use strict";
                    jQuery("#filter_classes").bind("click", function(e) {
                      bp_popup_init(e)
                Severity: Major
                Found in app/assets/javascripts/bp_annotatorplus.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_annotator.js on lines 335..376
                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_annotatorplus.js and 1 other location - About 1 day to fix
                app/assets/javascripts/bp_annotator.js on lines 138..163

                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_ontologies = {
                  init: function() {
                    "use strict";
                    jQuery("#filter_ontologies").bind("click", function(e) {
                      bp_popup_init(e)
                Severity: Major
                Found in app/assets/javascripts/bp_annotatorplus.js and 3 other locations - About 1 day to fix
                app/assets/javascripts/bp_annotator.js on lines 165..205
                app/assets/javascripts/bp_annotator.js on lines 250..290
                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_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_annotatorplus.js and 3 other locations - About 1 day to fix
                app/assets/javascripts/bp_annotator.js on lines 165..205
                app/assets/javascripts/bp_annotator.js on lines 250..290
                app/assets/javascripts/bp_annotatorplus.js on lines 206..246

                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_annotatorplus.js and 1 other location - About 1 day to fix
                app/assets/javascripts/bp_annotator.js on lines 428..450

                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_annotatorplus.js and 1 other location - About 1 day to fix
                app/assets/javascripts/bp_annotator.js on lines 514..544

                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_annotatorplus.js and 1 other location - About 7 hrs to fix
                app/assets/javascripts/bp_annotator.js on lines 378..391

                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_annotatorplus.js and 1 other location - About 6 hrs to fix
                app/assets/javascripts/bp_annotator.js on lines 122..136

                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_annotatorplus.js and 1 other location - About 5 hrs to fix
                app/assets/javascripts/bp_annotator.js on lines 745..758

                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_annotatorplus.js and 1 other location - About 4 hrs to fix
                app/assets/javascripts/bp_annotator.js on lines 394..407

                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_annotatorplus.js and 1 other location - About 4 hrs to fix
                app/assets/javascripts/bp_annotator.js on lines 546..558

                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

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

                      jQuery.each(annotation.hierarchy, function(i, h) {
                        h_c = get_class_details_from_raw(h.annotatedClass);
                        cells = [h_c.cls_link, h_c.ont_link, match_type, cls.semantic_types, text_markup, cls.cls_link, cls.ont_link, get_annotation_score(h), get_context_value(a.negationContext), get_context_value(a.experiencerContext), get_context_value(a.temporalityContext)];
                        rows.push(cells);
                      }); // hierarchy loop
                Severity: Major
                Found in app/assets/javascripts/bp_annotatorplus.js and 1 other location - About 4 hrs to fix
                app/assets/javascripts/bp_annotatorplus.js on lines 738..742

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

                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

                      jQuery.each(annotation.mappings, function(i, m) {
                        m_c = get_class_details_from_raw(m.annotatedClass);
                        cells = [m_c.cls_link, m_c.ont_link, match_type, cls.semantic_types, text_markup, cls.cls_link, cls.ont_link, get_annotation_score(m), get_context_value(a.negationContext), get_context_value(a.experiencerContext), get_context_value(a.temporalityContext)];
                        rows.push(cells);
                      }); // mappings loop
                Severity: Major
                Found in app/assets/javascripts/bp_annotatorplus.js and 1 other location - About 4 hrs to fix
                app/assets/javascripts/bp_annotatorplus.js on lines 730..734

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

                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_annotatorplus.js and 1 other location - About 3 hrs to fix
                app/assets/javascripts/bp_annotator.js on lines 501..512

                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_annotatorplus.js and 2 other locations - About 3 hrs to fix
                app/assets/javascripts/bp_annotator.js on lines 92..98
                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 3 locations. Consider refactoring.
                Open

                  if (jQuery("#semantic_groups").val() !== null) {
                    params.semantic_groups = jQuery("#semantic_groups").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_annotatorplus.js and 2 other locations - About 3 hrs to fix
                app/assets/javascripts/bp_annotator.js on lines 92..98
                app/assets/javascripts/bp_annotatorplus.js on lines 125..131

                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 toggle_advanced_options() {
                  $("#advanced-options-container").toggle();
                  var text = $("#advanced-options-container").is(':visible') ? "Hide advanced options <<" : "Show advanced options >>";
                  $("#advancedOptionsLink").text(text);
                }
                Severity: Major
                Found in app/assets/javascripts/bp_annotatorplus.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/bp_recommender.js on lines 5..9

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

                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 = "The patient has no sign of melanoma but his father had skin cancer. The epithelial tissue cells show no abnormal activity.";
                  jQuery("#annotation_text").focus();
                Severity: Minor
                Found in app/assets/javascripts/bp_annotatorplus.js and 1 other location - About 55 mins to fix
                app/assets/javascripts/bp_annotator.js on lines 30..36

                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_annotatorplus.js and 1 other location - About 50 mins to fix
                app/assets/javascripts/bp_annotator.js on lines 49..52

                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_annotatorplus.js and 1 other location - About 50 mins to fix
                app/assets/javascripts/bp_annotator.js on lines 87..89

                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

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

                  if (params.experiencer) {
                    annotationsTable.fnSetColumnVis(BP_COLUMNS.experiencer, true);
                  } else {
                    annotationsTable.fnSetColumnVis(BP_COLUMNS.experiencer, false);
                  }
                Severity: Major
                Found in app/assets/javascripts/bp_annotatorplus.js and 3 other locations - About 35 mins to fix
                app/assets/javascripts/bp_annotatorplus.js on lines 82..86
                app/assets/javascripts/bp_annotatorplus.js on lines 87..91
                app/assets/javascripts/bp_annotatorplus.js on lines 97..101

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

                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 (params.score) {
                    annotationsTable.fnSetColumnVis(BP_COLUMNS.score, true);
                  } else {
                    annotationsTable.fnSetColumnVis(BP_COLUMNS.score, false);
                  }
                Severity: Major
                Found in app/assets/javascripts/bp_annotatorplus.js and 3 other locations - About 35 mins to fix
                app/assets/javascripts/bp_annotatorplus.js on lines 87..91
                app/assets/javascripts/bp_annotatorplus.js on lines 92..96
                app/assets/javascripts/bp_annotatorplus.js on lines 97..101

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

                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 (params.temporality) {
                    annotationsTable.fnSetColumnVis(BP_COLUMNS.temporality, true);
                  } else {
                    annotationsTable.fnSetColumnVis(BP_COLUMNS.temporality, false);
                  }
                Severity: Major
                Found in app/assets/javascripts/bp_annotatorplus.js and 3 other locations - About 35 mins to fix
                app/assets/javascripts/bp_annotatorplus.js on lines 82..86
                app/assets/javascripts/bp_annotatorplus.js on lines 87..91
                app/assets/javascripts/bp_annotatorplus.js on lines 92..96

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

                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 (params.negation) {
                    annotationsTable.fnSetColumnVis(BP_COLUMNS.negation, true);
                  } else {
                    annotationsTable.fnSetColumnVis(BP_COLUMNS.negation, false);
                  }
                Severity: Major
                Found in app/assets/javascripts/bp_annotatorplus.js and 3 other locations - About 35 mins to fix
                app/assets/javascripts/bp_annotatorplus.js on lines 82..86
                app/assets/javascripts/bp_annotatorplus.js on lines 92..96
                app/assets/javascripts/bp_annotatorplus.js on lines 97..101

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

                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