ncbo/bioportal_web_ui

View on GitHub

Showing 628 of 628 total issues

Function bp_autocomplete has 371 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    jQuery.bp_autocomplete = function(input, options) {
      // Create a link to self
      var me = this;

      // Create jQuery object for input element
Severity: Major
Found in app/assets/javascripts/bp_crossdomain_autocomplete.js - About 1 day to fix

    Function NCBOTree has 370 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      $.fn.NCBOTree = function(opt) {
        var OPTIONS;
        var ROOT_ID = "roots";
    
        OPTIONS = {
    Severity: Major
    Found in public/widgets/jquery.ncbo.tree.js - About 1 day to fix

      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_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

      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

      Function bioportal_autocomplete has 366 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          jQuery.bioportal_autocomplete = function(input, options) {
            // Create a link to self
            var me = this;
      
            // Create jQuery object for input element

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

        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

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

          function bpFormSelect(li) {
            var input = this.extraParams.input;
            switch (this.extraParams.target_property) {
              case "uri":
                jQuery(input).val(li.extra[3])
          Severity: Major
          Found in public/javascripts/widgets/form_complete.js and 1 other location - About 1 day to fix
          app/assets/javascripts/bp_form_complete.js on lines 191..209

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

          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 bpFormSelect(li) {
            var input = this.extraParams.input;
            switch (this.extraParams.target_property) {
              case "uri":
                jQuery(input).val(li.extra[3])
          Severity: Major
          Found in app/assets/javascripts/bp_form_complete.js and 1 other location - About 1 day to fix
          public/javascripts/widgets/form_complete.js on lines 328..346

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

          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

          Function NCBOTree has 309 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            var NCBOTree = function(element, opt) {
              var _this = this;
              var OPTIONS;
              var ROOT_ID = "roots";
              var mousePressed = false;
          Severity: Major
          Found in public/widgets/jquery.ncbo.tree-2.0.0.js - About 1 day to fix

            Function NCBOTree has 309 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              var NCBOTree = function(element, opt) {
                var _this = this;
                var OPTIONS;
                var ROOT_ID = "roots";
                var mousePressed = false;
            Severity: Major
            Found in public/widgets/jquery.ncbo.tree-2.0.1.js - About 1 day to fix

              Function NCBOTree has 309 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                var NCBOTree = function(element, opt) {
                  var _this = this;
                  var OPTIONS;
                  var ROOT_ID = "roots";
                  var mousePressed = false;
              Severity: Major
              Found in public/widgets/jquery.ncbo.tree-2.0.2.js - About 1 day to fix

                Function app has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring.
                Open

                .controller('OntologyList', ['$scope', '$animate', '$timeout', function($scope, $animate, $timeout) {
                  // Default values
                  $scope.visible_ont_count = 0;
                  $scope.ontology_sort_order = "-popularity";
                  $scope.previous_sort_order = "-popularity";
                Severity: Minor
                Found in public/browse/app.js - About 1 day 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

                if (typeof jQuery == 'undefined') {
                  var jq, jqMigrate, scriptLoc = document.getElementsByTagName('script')[0].parentElement;
                  jq = document.createElement('script');
                  jqMigrate = document.createElement('script');
                  jq.type = jqMigrate.type = "text/javascript";
                Severity: Major
                Found in public/javascripts/widgets/form_complete.js and 1 other location - About 1 day to fix
                public/javascripts/widgets/quick_jump.js on lines 32..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 269.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                if (typeof jQuery == 'undefined') {
                  var jq, jqMigrate, scriptLoc = document.getElementsByTagName('script')[0].parentElement;
                  jq = document.createElement('script');
                  jqMigrate = document.createElement('script');
                  jq.type = jqMigrate.type = "text/javascript";
                Severity: Major
                Found in public/javascripts/widgets/quick_jump.js and 1 other location - About 1 day to fix
                public/javascripts/widgets/form_complete.js on lines 31..51

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

                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 bpMinVersion(min, actual) {
                  function parseVersionString (str) {
                    if (typeof(str) != 'string') { return false; }
                    var x = str.split('.');
                    var maj = parseInt(x[0]) || 0;
                Severity: Major
                Found in public/javascripts/widgets/quick_jump.js and 1 other location - About 1 day to fix
                public/javascripts/widgets/form_complete.js on lines 2..29

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

                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 bpMinVersion(min, actual) {
                  function parseVersionString (str) {
                    if (typeof(str) != 'string') { return false; }
                    var x = str.split('.');
                    var maj = parseInt(x[0]) || 0;
                Severity: Major
                Found in public/javascripts/widgets/form_complete.js and 1 other location - About 1 day to fix
                public/javascripts/widgets/quick_jump.js on lines 3..30

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

                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

                Severity
                Category
                Status
                Source
                Language