ncbo/bioportal_web_ui

View on GitHub

Showing 306 of 628 total issues

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

    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

      Method create has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
      Open

        def create
          params[:mappings] ||= []
          params[:max_level] ||= 0
          params[:ontologies] ||= []
          params[:semantic_types] ||= []
      Severity: Minor
      Found in app/controllers/annotatorplus_controller.rb - 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

      Function getRecommendations has 173 lines of code (exceeds 25 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: Major
      Found in app/assets/javascripts/bp_recommender.js - About 6 hrs to fix

        Function performAnimation has 172 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              function performAnimation(animationEvent, className, element, parentElement, afterElement, domOperation, options, doneCallback) {
                var noopCancel = noop;
                var runner = animationRunner(element, animationEvent, className, options);
                if (!runner) {
                  fireDOMOperation();
        Severity: Major
        Found in public/browse/lib/angular-animate/angular-animate.js - About 6 hrs to fix

          Function controller has 168 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      controller: ['$scope', '$element', '$attrs', '$interpolate', function ($scope, $element, $attrs, $interpolate)
                      {
                          var showHideBinder = function (elm, attr, value)
                          {
                              var show = (attr === 'show') ? '' : 'none';
          Severity: Major
          Found in public/browse/lib/angular-bindonce/bindonce.js - About 6 hrs to fix

            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

              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

                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

                    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

                      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() {

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

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

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

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

                            Function animationRunner has 144 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

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

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

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

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

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

                                  Function animateRun has 117 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                        function animateRun(animationEvent, element, className, activeAnimationComplete, styles) {
                                          var node = extractElementNode(element);
                                          var elementData = element.data(NG_ANIMATE_CSS_DATA_KEY);
                                          if (node.getAttribute('class').indexOf(className) == -1 || !elementData) {
                                            activeAnimationComplete();
                                  Severity: Major
                                  Found in public/browse/lib/angular-animate/angular-animate.js - About 4 hrs to fix

                                    File mustache.js has 354 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    /*!
                                     * mustache.js - Logic-less {{mustache}} templates with JavaScript
                                     * http://github.com/janl/mustache.js
                                     */
                                    
                                    
                                    Severity: Minor
                                    Found in public/browse/lib/lunr.js/example/mustache.js - About 4 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language