ncbo/bioportal_web_ui

View on GitHub

Showing 628 of 628 total issues

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

function getScript(url){
    return new Promise((resolve, reject) => {
        const script = document.createElement('script')
        script.src = url
        script.async = true
Severity: Major
Found in public/javascripts/widgets/quick_jump.js and 1 other location - About 6 hrs to fix
public/javascripts/widgets/form_complete.js on lines 106..126

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

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 getScript(url){
    return new Promise((resolve, reject) => {
        const script = document.createElement('script')
        script.src = url
        script.async = true
Severity: Major
Found in public/javascripts/widgets/form_complete.js and 1 other location - About 6 hrs to fix
public/javascripts/widgets/quick_jump.js on lines 121..141

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

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 161.

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

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

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

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

Refactorings

Further Reading

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

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

Class ApplicationController has 45 methods (exceeds 20 allowed). Consider refactoring.
Open

class ApplicationController < ActionController::Base
  helper :all # include all helpers, all the time
  helper_method :bp_config_json, :current_license, :using_captcha?

  # Pull configuration parameters for REST connection.
Severity: Minor
Found in app/controllers/application_controller.rb - About 6 hrs to fix

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

    lunr.TokenStore.prototype.expand = function (token, memo) {
      var root = this.getNode(token),
          docs = root.docs || {},
          memo = memo || []
    
    
    Severity: Major
    Found in public/browse/lib/lunr.js/lunr.js and 1 other location - About 6 hrs to fix
    public/browse/lib/lunr.js/lib/token_store.js on lines 164..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 158.

    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.TokenStore.prototype.expand = function (token, memo) {
      var root = this.getNode(token),
          docs = root.docs || {},
          memo = memo || []
    
    
    Severity: Major
    Found in public/browse/lib/lunr.js/lib/token_store.js and 1 other location - About 6 hrs to fix
    public/browse/lib/lunr.js/lunr.js on lines 1824..1839

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

    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.Index.prototype.idf = function (term) {
      var cacheKey = "@" + term
      if (Object.prototype.hasOwnProperty.call(this._idfCache, cacheKey)) return this._idfCache[cacheKey]
    
      var documentFrequency = this.tokenStore.count(term),
    Severity: Major
    Found in public/browse/lib/lunr.js/lunr.js and 1 other location - About 6 hrs to fix
    public/browse/lib/lunr.js/lib/index.js on lines 247..259

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

    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.Index.prototype.idf = function (term) {
      var cacheKey = "@" + term
      if (Object.prototype.hasOwnProperty.call(this._idfCache, cacheKey)) return this._idfCache[cacheKey]
    
      var documentFrequency = this.tokenStore.count(term),
    Severity: Major
    Found in public/browse/lib/lunr.js/lib/index.js and 1 other location - About 6 hrs to fix
    public/browse/lib/lunr.js/lunr.js on lines 1027..1039

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

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

          function($rootScope, $location, $routeParams, $q, $injector, $templateRequest, $sce) {
    
        /**
         * @ngdoc service
         * @name $route
    Severity: Major
    Found in public/browse/lib/angular-route/angular-route.js - About 6 hrs to fix

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

            TREE.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.js and 1 other location - About 5 hrs to fix
      app/assets/javascripts/bp_property_tree.js on lines 142..155

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

      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

          this.nodeToggle = function(obj) {
            var childUl = $('>ul',obj);
            if (childUl.is(':visible')) {
              obj.className = obj.className.replace('open','close');
              childUl.hide();
      Severity: Major
      Found in app/assets/javascripts/bp_property_tree.js and 1 other location - About 5 hrs to fix
      public/widgets/jquery.ncbo.tree.js on lines 209..222

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

      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_crossdomain_autocomplete.js has 414 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      // Generally we use jQuery as the keyword but some people
      // will use another framework which takes control of the $.
      // To avoid re-writing this script we'll use a wrapper.
      (function($) {
        $(function() {
      Severity: Minor
      Found in public/javascripts/bp_crossdomain_autocomplete.js - About 5 hrs to fix

        File bp_crossdomain_autocomplete.js has 414 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // Generally we use jQuery as the keyword but some people
        // will use another framework which takes control of the $.
        // To avoid re-writing this script we'll use a wrapper.
        (function($) {
          $(function() {
        Severity: Minor
        Found in app/assets/javascripts/bp_crossdomain_autocomplete.js - About 5 hrs to fix

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

            def get_annotated_classes(annotations, semantic_types=[])
              # Use batch service to get class prefLabels
              class_list = []
              annotations.each {|a| class_list << get_annotated_class_hash(a) }
              hierarchy = annotations.map {|a| a if a.keys.include? 'hierarchy' }.compact
          Severity: Major
          Found in app/controllers/annotator_controller.rb and 1 other location - About 5 hrs to fix
          app/controllers/annotatorplus_controller.rb on lines 164..207

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

          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

            def get_annotated_classes(annotations, semantic_types=[])
              # Use batch service to get class prefLabels
              class_list = []
              annotations.each {|a| class_list << get_annotated_class_hash(a) }
              hierarchy = annotations.map {|a| a if a.keys.include? 'hierarchy' }.compact
          Severity: Major
          Found in app/controllers/annotatorplus_controller.rb and 1 other location - About 5 hrs to fix
          app/controllers/annotator_controller.rb on lines 139..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 194.

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

          function createHttpBackendMock($rootScope, $delegate, $browser) {
            var definitions = [],
                expectations = [],
                responses = [],
                responsesPush = angular.bind(responses, responses.push),
          Severity: Major
          Found in public/browse/lib/angular-mocks/angular-mocks.js - About 5 hrs to fix

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

            lunr.EventEmitter.prototype.addListener = function () {
              var args = Array.prototype.slice.call(arguments),
                  fn = args.pop(),
                  names = args
            
            
            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/event_emitter.js on lines 24..35

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

            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.EventEmitter.prototype.addListener = function () {
              var args = Array.prototype.slice.call(arguments),
                  fn = args.pop(),
                  names = args
            
            
            Severity: Major
            Found in public/browse/lib/lunr.js/lib/event_emitter.js and 1 other location - About 5 hrs to fix
            public/browse/lib/lunr.js/lunr.js on lines 107..118

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

            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 crossdomain_autocomplete.js has 409 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            // Generally we use jQuery as the keyword but some people
            // will use another framework which takes control of the $.
            // To avoid re-writing this script we'll use a wrapper.
            (function($) {
              $(function() {
              Severity
              Category
              Status
              Source
              Language