ncbo/bioportal_web_ui

View on GitHub

Showing 628 of 628 total issues

Method proposal_html has 82 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def proposal_html(note)
    return "" unless note.respond_to?(:proposal) && note.proposal
    case note.proposal.type
    when "ProposalNewClass"
      html = <<-html
Severity: Major
Found in app/helpers/notes_helper.rb - About 3 hrs to fix

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

    lunr.Pipeline.prototype.add = function () {
      var fns = Array.prototype.slice.call(arguments)
    
      fns.forEach(function (fn) {
        lunr.Pipeline.warnIfFunctionNotRegistered(fn)
    Severity: Major
    Found in public/browse/lib/lunr.js/lunr.js and 1 other location - About 3 hrs to fix
    public/browse/lib/lunr.js/lib/pipeline.js on lines 113..120

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

    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.Pipeline.prototype.add = function () {
      var fns = Array.prototype.slice.call(arguments)
    
      fns.forEach(function (fn) {
        lunr.Pipeline.warnIfFunctionNotRegistered(fn)
    Severity: Major
    Found in public/browse/lib/lunr.js/lib/pipeline.js and 1 other location - About 3 hrs to fix
    public/browse/lib/lunr.js/lunr.js on lines 313..320

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

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

                        runBinders: function ()
                        {
                            while (this.binders.length > 0)
                            {
                                var binder = this.binders.shift();
    Severity: Major
    Found in public/browse/lib/angular-bindonce/bindonce.js - About 3 hrs to fix

      Function formComplete_formatItem has 77 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function formComplete_formatItem(row) {
      
          var input = this.extraParams.input;
          var BP_include_definitions = jQuery(input).attr("data-bp_include_definitions");
          if (typeof BP_include_definitions === "undefined") {
      Severity: Major
      Found in public/javascripts/widgets/form_complete.js - About 3 hrs to fix

        File bindonce.js has 294 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        (function () {
            "use strict";
            /**
             * Bindonce - Zero watches binding for AngularJs
             * @version v0.3.3
        Severity: Minor
        Found in public/browse/lib/angular-bindonce/bindonce.js - About 3 hrs to fix

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

                TREE.closeNearby = function(obj) {
                  $(obj).siblings().filter('.folder-open, .folder-open-last').each(function(){
                    var childUl = $('>ul',this);
                    var className = this.className;
                    this.className = className.replace('open', 'close');
          Severity: Major
          Found in public/widgets/jquery.ncbo.tree.js and 1 other location - About 3 hrs to fix
          app/assets/javascripts/bp_property_tree.js on lines 133..140

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

          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

              this.closeNearby = function(obj) {
                $(obj).siblings().filter('.folder-open, .folder-open-last').each(function(){
                  var childUl = $('>ul',this);
                  var className = this.className;
                  this.className = className.replace('open', 'close');
          Severity: Major
          Found in app/assets/javascripts/bp_property_tree.js and 1 other location - About 3 hrs to fix
          public/widgets/jquery.ncbo.tree.js on lines 200..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 96.

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

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

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

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

          Refactorings

          Further Reading

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

            if (jQuery("#semantic_types").val() !== null) {
              params.semantic_types = jQuery("#semantic_types").val();
              annotationsTable.fnSetColumnVis(BP_COLUMNS.sem_types, true);
              jQuery("#results_error").html("Only results from ontologies with semantic types available are displayed.");
            } else {
          Severity: Major
          Found in app/assets/javascripts/bp_annotator.js and 2 other locations - About 3 hrs to fix
          app/assets/javascripts/bp_annotatorplus.js on lines 125..131
          app/assets/javascripts/bp_annotatorplus.js on lines 133..139

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 95.

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

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

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

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

          Refactorings

          Further Reading

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

            if (jQuery("#semantic_types").val() !== null) {
              params.semantic_types = jQuery("#semantic_types").val();
              annotationsTable.fnSetColumnVis(BP_COLUMNS.sem_types, true);
              jQuery("#results_error").html("Only results from ontologies with semantic types available are displayed.");
            } else {
          Severity: Major
          Found in app/assets/javascripts/bp_annotatorplus.js and 2 other locations - About 3 hrs to fix
          app/assets/javascripts/bp_annotator.js on lines 92..98
          app/assets/javascripts/bp_annotatorplus.js on lines 133..139

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 95.

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

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

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

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

          Refactorings

          Further Reading

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

            if (jQuery("#semantic_groups").val() !== null) {
              params.semantic_groups = jQuery("#semantic_groups").val();
              annotationsTable.fnSetColumnVis(BP_COLUMNS.sem_types, true);
              jQuery("#results_error").html("Only results from ontologies with semantic types available are displayed.");
            } else {
          Severity: Major
          Found in app/assets/javascripts/bp_annotatorplus.js and 2 other locations - About 3 hrs to fix
          app/assets/javascripts/bp_annotator.js on lines 92..98
          app/assets/javascripts/bp_annotatorplus.js on lines 125..131

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 95.

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

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

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

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

          Refactorings

          Further Reading

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

              groups: {
                active: [],
                ont_property: "groups",
                filter: function(ontology) {
                  if ($scope.facets.groups.active.length == 0)
          Severity: Major
          Found in public/browse/app.js and 2 other locations - About 2 hrs to fix
          public/browse/app.js on lines 85..95
          public/browse/app.js on lines 96..106

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

          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.Pipeline.registerFunction = function (fn, label) {
            if (label in this.registeredFunctions) {
              lunr.utils.warn('Overwriting existing registered function: ' + label)
            }
          
          
          Severity: Major
          Found in public/browse/lib/lunr.js/lunr.js and 1 other location - About 2 hrs to fix
          public/browse/lib/lunr.js/lib/pipeline.js on lines 54..61

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

          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

              artifacts: {
                active: [],
                ont_property: "artifacts",
                filter: function(ontology) {
                  if ($scope.facets.artifacts.active.length == 0)
          Severity: Major
          Found in public/browse/app.js and 2 other locations - About 2 hrs to fix
          public/browse/app.js on lines 74..84
          public/browse/app.js on lines 85..95

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

          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

            describe('view2', function() {
          
              beforeEach(function() {
                browser.get('index.html#/view2');
              });
          Severity: Major
          Found in public/browse/e2e-tests/scenarios.js and 1 other location - About 2 hrs to fix
          public/browse/e2e-tests/scenarios.js on lines 14..26

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

          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.Pipeline.registerFunction = function (fn, label) {
            if (label in this.registeredFunctions) {
              lunr.utils.warn('Overwriting existing registered function: ' + label)
            }
          
          
          Severity: Major
          Found in public/browse/lib/lunr.js/lib/pipeline.js and 1 other location - About 2 hrs to fix
          public/browse/lib/lunr.js/lunr.js on lines 254..261

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

          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

              categories: {
                active: [],
                ont_property: "categories",
                filter: function(ontology) {
                  if ($scope.facets.categories.active.length == 0)
          Severity: Major
          Found in public/browse/app.js and 2 other locations - About 2 hrs to fix
          public/browse/app.js on lines 74..84
          public/browse/app.js on lines 96..106

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

          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

            describe('view1', function() {
          
              beforeEach(function() {
                browser.get('index.html#/view1');
              });
          Severity: Major
          Found in public/browse/e2e-tests/scenarios.js and 1 other location - About 2 hrs to fix
          public/browse/e2e-tests/scenarios.js on lines 29..41

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

          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

          Method index has 73 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def index
              @app_name = "FacetedBrowsing"
              @app_dir = "/browse"
              @base_path = @app_dir
              ontologies = LinkedData::Client::Models::Ontology.all(include: LinkedData::Client::Models::Ontology.include_params + ",viewOf", include_views: true, display_context: false)
          Severity: Major
          Found in app/controllers/ontologies_controller.rb - About 2 hrs to fix

            Function _showStatusMessages has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
            Open

            function _showStatusMessages(success, errors, notices, isAppendMode) {
              if (success.length > 0) {
                if (isAppendMode) {
                  var appendStr = (jQuery.trim(jQuery('#success_message').html()).length) ? ", " : "";
                  jQuery("#success_message").append(appendStr + success.join(", ")).html();
            Severity: Minor
            Found in app/assets/javascripts/bp_admin.js - About 2 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Severity
            Category
            Status
            Source
            Language