ncbo/bioportal_web_ui

View on GitHub

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

    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

          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

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

            UpdateCheck.prototype.onSuccessAction = function(data, ontology, deferredObj) {
              var self = this;
              delete data["success"];
              updateInfo = data["update_info"];
            
            
            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

            Method build_tree has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
            Open

              def build_tree(node, string, id)
                if node.children.nil? || node.children.length < 1
                  return string # unchanged
                end
                node.children.sort! {|a,b| (a.prefLabel || a.id).downcase <=> (b.prefLabel || b.id).downcase}
            Severity: Minor
            Found in app/helpers/application_helper.rb - 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

            Function formComplete_setup_functions has 70 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function formComplete_setup_functions() {
              jQuery("input[class*='bp_form_complete']").each(function(){
                var classes = this.className.split(" ");
                var values;
                var ontology_id;
            Severity: Major
            Found in public/javascripts/widgets/form_complete.js - About 2 hrs to fix

              Method _process_ontologies has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                def _process_ontologies(success_keyword, error_keyword, process_proc)
                  response = { errors: '', success: '' }
              
                  if params['ontologies'].blank?
                    response[:errors] = "No ontologies parameter passed. Syntax: ?ontologies=ONT1,ONT2,...,ONTN"
              Severity: Minor
              Found in app/controllers/admin_controller.rb - 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

              File application_helper.rb has 281 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require 'uri'
              require 'cgi'
              require 'digest/sha1'
              require 'pry' # used in a rescue
              
              
              Severity: Minor
              Found in app/helpers/application_helper.rb - About 2 hrs to fix

                Function _ajaxCall has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                AjaxAction.prototype._ajaxCall = function() {
                  var self = this;
                  var success = [];
                  var errors = [];
                  var notices = [];
                Severity: Major
                Found in app/assets/javascripts/bp_admin.js - About 2 hrs to fix

                  Function $IntervalProvider has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  angular.mock.$IntervalProvider = function() {
                    this.$get = ['$browser', '$rootScope', '$q', '$$q',
                         function($browser,   $rootScope,   $q,   $$q) {
                      var repeatFns = [],
                          nextRepeatId = 0,
                  Severity: Major
                  Found in public/browse/lib/angular-mocks/angular-mocks.js - About 2 hrs to fix

                    Function bp_internal_formComplete_setup_functions has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function bp_internal_formComplete_setup_functions() {
                      jQuery("input[class*='bp_internal_form_complete']").each(function(){
                        var classes = this.className.split(" ");
                        var values;
                        var ontology_id;
                    Severity: Major
                    Found in app/assets/javascripts/bp_form_complete.js - About 2 hrs to fix

                      Method json_search has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def json_search
                          if params[:q].nil?
                            render :text => "No search class provided"
                            return
                          end
                      Severity: Minor
                      Found in app/controllers/search_controller.rb - 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

                      Function $get has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                             function($browser,   $rootScope,   $q,   $$q) {
                          var repeatFns = [],
                              nextRepeatId = 0,
                              now = 0;
                      
                      
                      Severity: Major
                      Found in public/browse/lib/angular-mocks/angular-mocks.js - About 2 hrs to fix

                        Function setupModuleLoader has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function setupModuleLoader(window) {
                        
                          var $injectorMinErr = minErr('$injector');
                          var ngMinErr = minErr('ng');
                        
                        
                        Severity: Major
                        Found in public/browse/lib/angular-loader/angular-loader.js - About 2 hrs to fix

                          File text.js has 273 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          /**
                           * @license RequireJS text 2.0.10 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
                           * Available via the MIT or new BSD license.
                           * see: http://github.com/requirejs/text for details
                           */
                          Severity: Minor
                          Found in public/browse/lib/lunr.js/example/text.js - About 2 hrs to fix

                            File jquery.ncbo.autocomplete.js has 272 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            /*jshint curly: true, eqeqeq: true, undef: true, devel: true, browser: true */
                            /*global jQuery */
                            
                            /**
                             * Turn a text box into an auto suggest box which search's and
                            Severity: Minor
                            Found in public/widgets/jquery.ncbo.autocomplete.js - About 2 hrs to fix

                              Function commitRoute has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function commitRoute() {
                                    var lastRoute = $route.current;
                                    var nextRoute = preparedRoute;
                              
                                    if (preparedRouteIsUpdateOnly) {
                              Severity: Major
                              Found in public/browse/lib/angular-route/angular-route.js - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language