ncbo/bioportal_web_ui

View on GitHub

Showing 628 of 628 total issues

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

lunr.SortedSet.prototype.intersect = function (otherSet) {
  var intersectSet = new lunr.SortedSet,
      i = 0, j = 0,
      a_len = this.length, b_len = otherSet.length,
      a = this.elements, b = otherSet.elements
Severity: Major
Found in public/browse/lib/lunr.js/lib/sorted_set.js and 1 other location - About 1 day to fix
public/browse/lib/lunr.js/lunr.js on lines 704..731

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

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

function $RouteProvider() {
  function inherit(parent, extra) {
    return angular.extend(Object.create(parent), extra);
  }

Severity: Major
Found in public/browse/lib/angular-route/angular-route.js - About 1 day to fix

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

    lunr.Vector.prototype.insert = function (idx, val) {
      var list = this.list
    
      if (!list) {
        this.list = new lunr.Vector.Node (idx, val, list)
    Severity: Major
    Found in public/browse/lib/lunr.js/lib/vector.js and 1 other location - About 1 day to fix
    public/browse/lib/lunr.js/lunr.js on lines 459..481

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

    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.Vector.prototype.insert = function (idx, val) {
      var list = this.list
    
      if (!list) {
        this.list = new lunr.Vector.Node (idx, val, list)
    Severity: Major
    Found in public/browse/lib/lunr.js/lunr.js and 1 other location - About 1 day to fix
    public/browse/lib/lunr.js/lib/vector.js on lines 42..64

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

    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 acronym_from_virtual.rb has 535 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    BPIDResolver::ACRONYM_FROM_VIRTUAL = {
      "old:acronym_from_virtual:3013" => "DIAGONT",
      "old:acronym_from_virtual:3245" => "SuicidO",
      "old:acronym_from_virtual:1247" => "GEOSPECIES",
      "old:acronym_from_virtual:1054" => "AMINO-ACID",
    Severity: Major
    Found in lib/resolver/acronym_from_virtual.rb - About 1 day to fix

      File virtual_from_acronym.rb has 533 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      BPIDResolver::VIRTUAL_FROM_ACRONYM = {
        "JERM" => 1488,
        "OGSF" => 3214,
        "NATPRO" => 3004,
        "citation" => 2114,
      Severity: Major
      Found in lib/resolver/virtual_from_acronym.rb - About 1 day to fix

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

          $.fn.NCBOTree = function(options) {
            return this.each(function() {
              var $this = $(this);
        
              // Return early if this element already has a plugin instance
        Severity: Major
        Found in public/widgets/jquery.ncbo.tree-2.0.1.js and 2 other locations - About 1 day to fix
        public/widgets/jquery.ncbo.tree-2.0.0.js on lines 394..419
        public/widgets/jquery.ncbo.tree-2.0.2.js on lines 394..419

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

        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

          $.fn.NCBOTree = function(options) {
            return this.each(function() {
              var $this = $(this);
        
              // Return early if this element already has a plugin instance
        Severity: Major
        Found in public/widgets/jquery.ncbo.tree-2.0.0.js and 2 other locations - About 1 day to fix
        public/widgets/jquery.ncbo.tree-2.0.1.js on lines 394..419
        public/widgets/jquery.ncbo.tree-2.0.2.js on lines 394..419

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

        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

          $.fn.NCBOTree = function(options) {
            return this.each(function() {
              var $this = $(this);
        
              // Return early if this element already has a plugin instance
        Severity: Major
        Found in public/widgets/jquery.ncbo.tree-2.0.2.js and 2 other locations - About 1 day to fix
        public/widgets/jquery.ncbo.tree-2.0.0.js on lines 394..419
        public/widgets/jquery.ncbo.tree-2.0.1.js on lines 394..419

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

        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 application_controller.rb has 527 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require 'uri'
        require 'net/http'
        require 'net/https'
        require 'net/ftp'
        require 'json'
        Severity: Major
        Found in app/controllers/application_controller.rb - About 1 day to fix

          Function getRecommendations has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
          Open

          rec.getRecommendations = function() {
              rec.hideErrorMessages();
              var errors = false;
              // Checks if the input text field is empty
              if (($("#inputText").val().length == 0) || (rec.emptyInput==true))  {
          Severity: Minor
          Found in app/assets/javascripts/bp_recommender.js - About 7 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

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

          lunr.SortedSet.prototype.indexOf = function (elem, start, end) {
            var start = start || 0,
                end = end || this.elements.length,
                sectionLength = end - start,
                pivot = start + Math.floor(sectionLength / 2),
          Severity: Major
          Found in public/browse/lib/lunr.js/lunr.js and 1 other location - About 7 hrs to fix
          public/browse/lib/lunr.js/lib/sorted_set.js on lines 103..121

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

          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.indexOf = function (elem, start, end) {
            var start = start || 0,
                end = end || this.elements.length,
                sectionLength = end - start,
                pivot = start + Math.floor(sectionLength / 2),
          Severity: Major
          Found in public/browse/lib/lunr.js/lib/sorted_set.js and 1 other location - About 7 hrs to fix
          public/browse/lib/lunr.js/lunr.js on lines 645..663

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

          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

              var findRootNode = function(nodes) {
                var startingRoot = (OPTIONS.startingRoot == OPTIONS.defaultRoot) ? null : OPTIONS.startingRoot;
                if (startingRoot == null) {return nodes;}
          
                var foundNode = false;
          Severity: Major
          Found in public/widgets/jquery.ncbo.tree-2.0.0.js and 2 other locations - About 7 hrs to fix
          public/widgets/jquery.ncbo.tree-2.0.1.js on lines 165..182
          public/widgets/jquery.ncbo.tree-2.0.2.js on lines 165..182

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

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

              var findRootNode = function(nodes) {
                var startingRoot = (OPTIONS.startingRoot == OPTIONS.defaultRoot) ? null : OPTIONS.startingRoot;
                if (startingRoot == null) {return nodes;}
          
                var foundNode = false;
          Severity: Major
          Found in public/widgets/jquery.ncbo.tree-2.0.2.js and 2 other locations - About 7 hrs to fix
          public/widgets/jquery.ncbo.tree-2.0.0.js on lines 165..182
          public/widgets/jquery.ncbo.tree-2.0.1.js on lines 165..182

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

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 187.

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

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

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

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

          Refactorings

          Further Reading

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

              var findRootNode = function(nodes) {
                var startingRoot = (OPTIONS.startingRoot == OPTIONS.defaultRoot) ? null : OPTIONS.startingRoot;
                if (startingRoot == null) {return nodes;}
          
                var foundNode = false;
          Severity: Major
          Found in public/widgets/jquery.ncbo.tree-2.0.1.js and 2 other locations - About 7 hrs to fix
          public/widgets/jquery.ncbo.tree-2.0.0.js on lines 165..182
          public/widgets/jquery.ncbo.tree-2.0.2.js on lines 165..182

          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

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

              if (ontology_id !== "") {
                  if (BP_include_definitions) {
                      resultDiv.append(definitionDiv(result_ont_version, result_uri));
                  }
                  resultDiv.append(resultClassDiv);
          Severity: Major
          Found in public/javascripts/widgets/form_complete.js and 1 other location - About 7 hrs to fix
          public/javascripts/widgets/quick_jump.js on lines 206..224

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

          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 (BP_ontology_id !== "") {
                  if (BP_include_definitions) {
                      resultDiv.append(definitionDiv(result_ont_version, result_uri));
                  }
                  resultDiv.append(resultClassDiv);
          Severity: Major
          Found in public/javascripts/widgets/quick_jump.js and 1 other location - About 7 hrs to fix
          public/javascripts/widgets/form_complete.js on lines 201..219

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

          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