ncbo/bioportal_web_ui

View on GitHub

Showing 628 of 628 total issues

Function stemmer has 145 lines of code (exceeds 25 allowed). Consider refactoring.
Open

lunr.stemmer = (function(){
  var step2list = {
      "ational" : "ate",
      "tional" : "tion",
      "enci" : "ence",
Severity: Major
Found in public/browse/lib/lunr.js/lunr.js - About 5 hrs to fix

    Function stemmer has 145 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    lunr.stemmer = (function(){
      var step2list = {
          "ational" : "ate",
          "tional" : "tion",
          "enci" : "ence",
    Severity: Major
    Found in public/browse/lib/lunr.js/lib/stemmer.js - About 5 hrs to fix

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

          var nodeToggle = function(obj) {
            var childUl = $('>ul',obj);
            if (childUl.is(':visible')) {
              obj.className = obj.className.replace('open','close');
              childUl.hide();
      Severity: Major
      Found in public/widgets/jquery.ncbo.tree-2.0.1.js and 2 other locations - About 5 hrs to fix
      public/widgets/jquery.ncbo.tree-2.0.0.js on lines 193..206
      public/widgets/jquery.ncbo.tree-2.0.2.js on lines 193..206

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

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

          var nodeToggle = function(obj) {
            var childUl = $('>ul',obj);
            if (childUl.is(':visible')) {
              obj.className = obj.className.replace('open','close');
              childUl.hide();
      Severity: Major
      Found in public/widgets/jquery.ncbo.tree-2.0.2.js and 2 other locations - About 5 hrs to fix
      public/widgets/jquery.ncbo.tree-2.0.0.js on lines 193..206
      public/widgets/jquery.ncbo.tree-2.0.1.js on lines 193..206

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

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

          var nodeToggle = function(obj) {
            var childUl = $('>ul',obj);
            if (childUl.is(':visible')) {
              obj.className = obj.className.replace('open','close');
              childUl.hide();
      Severity: Major
      Found in public/widgets/jquery.ncbo.tree-2.0.0.js and 2 other locations - About 5 hrs to fix
      public/widgets/jquery.ncbo.tree-2.0.1.js on lines 193..206
      public/widgets/jquery.ncbo.tree-2.0.2.js on lines 193..206

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

      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 animationRunner has 144 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            function animationRunner(element, animationEvent, className, options) {
              //transcluded directives may sometimes fire an animation using only comment nodes
              //best to catch this early on to prevent any animation operations from occurring
              var node = element[0];
              if (!node) {
      Severity: Major
      Found in public/browse/lib/angular-animate/angular-animate.js - About 5 hrs to fix

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

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

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 150.

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

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

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

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

        Refactorings

        Further Reading

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

          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

        lunr.stopWordFilter.stopWords.elements = [
          "",
          "a",
          "able",
          "about",
        Severity: Major
        Found in public/browse/lib/lunr.js/lunr.js and 1 other location - About 5 hrs to fix
        public/browse/lib/lunr.js/lib/stop_word_filter.js on lines 24..145

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

        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

        lunr.stopWordFilter.stopWords.elements = [
          "",
          "a",
          "able",
          "about",
        Severity: Major
        Found in public/browse/lib/lunr.js/lib/stop_word_filter.js and 1 other location - About 5 hrs to fix
        public/browse/lib/lunr.js/lunr.js on lines 1511..1632

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

        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 (notices.length > 0) {
            if (isAppendMode) {
              var appendStr = (jQuery.trim(jQuery('#info_message').html()).length) ? ", " : "";
              jQuery("#info_message").append(appendStr + notices.join(", ")).html();
            } else {
        Severity: Major
        Found in app/assets/javascripts/bp_admin.js and 2 other locations - About 5 hrs to fix
        app/assets/javascripts/bp_admin.js on lines 598..606
        app/assets/javascripts/bp_admin.js on lines 608..616

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

        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 (errors.length > 0) {
            if (isAppendMode) {
              var appendStr = (jQuery.trim(jQuery('#error_message').html()).length) ? ", " : "";
              jQuery("#error_message").append(appendStr + errors.join(", ")).html();
            } else {
        Severity: Major
        Found in app/assets/javascripts/bp_admin.js and 2 other locations - About 5 hrs to fix
        app/assets/javascripts/bp_admin.js on lines 598..606
        app/assets/javascripts/bp_admin.js on lines 618..626

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

        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 (success.length > 0) {
            if (isAppendMode) {
              var appendStr = (jQuery.trim(jQuery('#success_message').html()).length) ? ", " : "";
              jQuery("#success_message").append(appendStr + success.join(", ")).html();
            } else {
        Severity: Major
        Found in app/assets/javascripts/bp_admin.js and 2 other locations - About 5 hrs to fix
        app/assets/javascripts/bp_admin.js on lines 608..616
        app/assets/javascripts/bp_admin.js on lines 618..626

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

        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 (row[0].match(regex) == null) {
                var contents = row[6].split("\t");
                var synonym = contents[0] || "";
                synonym = synonym.split(";");
                if (synonym !== "") {
        Severity: Major
        Found in public/javascripts/widgets/quick_jump.js and 1 other location - About 5 hrs to fix
        public/javascripts/widgets/form_complete.js on lines 162..172

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

        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 (row[0].match(regex) == null) {
                var contents = row[6].split("\t");
                var synonym = contents[0] || "";
                synonym = synonym.split(";");
                if (synonym !== "") {
        Severity: Major
        Found in public/javascripts/widgets/form_complete.js and 1 other location - About 5 hrs to fix
        public/javascripts/widgets/quick_jump.js on lines 169..179

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

        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 jquery.ncbo.tree.js has 374 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*
        * jQuery SimpleTree Drag&Drop plugin
        * Update on 22th May 2008
        * Version 0.3
        *
        Severity: Minor
        Found in public/widgets/jquery.ncbo.tree.js - About 5 hrs to fix

          Function displayOntologies has 121 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function displayOntologies(data, ontology) {
            var ontTable = null;
          
            if (jQuery.fn.dataTable.isDataTable('#adminOntologies')) {
              ontTable = jQuery('#adminOntologies').DataTable();
          Severity: Major
          Found in app/assets/javascripts/bp_admin.js - About 4 hrs to fix

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

            lunr.SortedSet.prototype.union = function (otherSet) {
              var longSet, shortSet, unionSet
            
              if (this.length >= otherSet.length) {
                longSet = this, shortSet = otherSet
            Severity: Major
            Found in public/browse/lib/lunr.js/lunr.js and 1 other location - About 4 hrs to fix
            public/browse/lib/lunr.js/lib/sorted_set.js on lines 214..228

            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

            lunr.SortedSet.prototype.union = function (otherSet) {
              var longSet, shortSet, unionSet
            
              if (this.length >= otherSet.length) {
                longSet = this, shortSet = otherSet
            Severity: Major
            Found in public/browse/lib/lunr.js/lib/sorted_set.js and 1 other location - About 4 hrs to fix
            public/browse/lib/lunr.js/lunr.js on lines 756..770

            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

            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

            Severity
            Category
            Status
            Source
            Language