hummingbird-me/hummingbird

View on GitHub

Showing 419 of 859 total issues

Consider simplifying this complex logical expression.
Open

        if ( ( ( $target[0].id !== $.datepicker._mainDivId &&
                $target.parents("#" + $.datepicker._mainDivId).length === 0 &&
                !$target.hasClass($.datepicker.markerClassName) &&
                !$target.closest("." + $.datepicker._triggerClass).length &&
                $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) ||
Severity: Critical
Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

            if(!(/^(document|window|parent)$/).test(o.containment)) {
                ce = $(o.containment)[0];
                co = $(o.containment).offset();
                over = ($(ce).css("overflow") !== "hidden");
    
    
    Severity: Critical
    Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

              if (this.floating && horizontalDirection) {
                  return ((horizontalDirection === "right" && isOverRightHalf) || (horizontalDirection === "left" && !isOverRightHalf));
              } else {
                  return verticalDirection && ((verticalDirection === "down" && isOverBottomHalf) || (verticalDirection === "up" && !isOverBottomHalf));
              }
      Severity: Critical
      Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

        Function template has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _.template = function(text, data, settings) {
            var render;
            settings = _.defaults({}, settings, _.templateSettings);
        
            // Combine delimiters into one regular expression via alternation.
        Severity: Minor
        Found in app/assets/javascripts/old/underscore-1.4.4.js - About 1 hr to fix

          Function _makeResizable has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _makeResizable: function() {
                  var that = this,
                      options = this.options,
                      handles = options.resizable,
                      // .ui-resizable has position: relative defined in the stylesheet
          Severity: Minor
          Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

            Function _eventHandler has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _eventHandler: function( event ) {
                    var options = this.options,
                        active = this.active,
                        clicked = $( event.currentTarget ),
                        clickedIsActive = clicked[ 0 ] === active[ 0 ],
            Severity: Minor
            Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

              Function setupParams has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                setupParams: function(paramSize, params, useRegister) {
                  var options = [], contexts = [], types = [], param, inverse, program;
              
                  options.push("hash:" + this.popStack());
              
              
              Severity: Minor
              Found in app/assets/javascripts/old/handlebars-1.0.0.js - About 1 hr to fix

                Method characters has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def characters
                    featured_chars = @main_noko.css('table div.picSurround a[href*="character/"]').map {|x|
                      x['href'].scan(/character\/(\d+)/)
                    }.flatten.map(&:to_i)
                
                
                Severity: Minor
                Found in lib/mal_import.rb - About 1 hr to fix

                  Function lifeSpentOnAnimeFmt has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    lifeSpentOnAnimeFmt: function () {
                      var days, hours, minutes, months, str, years;
                      minutes = this.get('userInfo.lifeSpentOnAnime');
                  
                      if (minutes === 0) { return "0 minutes"; }
                  Severity: Minor
                  Found in frontend/app/controllers/user/index.js - About 1 hr to fix

                    Function _attachments has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        _attachments: function(input, inst) {
                            var showOn, buttonText, buttonImage,
                                appendText = this._get(inst, "appendText"),
                                isRTL = this._get(inst, "isRTL");
                    
                    
                    Severity: Minor
                    Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

                      Function purchasePro has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          purchasePro: function() {
                            if (this.get('disablePurchase')) { return; }
                      
                            var self = this;
                            var tokenCallback = function(res) {
                      Severity: Minor
                      Found in frontend/app/controllers/pro.js - About 1 hr to fix

                        Method br_to_p has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def br_to_p(src)
                            src = '<p>' + src.gsub(/<br>\s*<br>/, '</p><p>') + '</p>'
                            doc = Nokogiri::HTML.fragment src
                            doc.traverse do |x|
                              next x.remove if x.name == 'br' && x.previous.nil?
                        Severity: Minor
                        Found in lib/mal_import.rb - About 1 hr 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 reposition has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            reposition : function (target, tip, classes) {
                              var width, nub, nubHeight, nubWidth, column, objPos;
                        
                              tip.css('visibility', 'hidden').show();
                        
                        
                        Severity: Minor
                        Found in public/2014/assets/js/foundation/foundation.tooltip.js - About 1 hr to fix

                          Function bridge has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          $.widget.bridge = function( name, object ) {
                              var fullName = object.prototype.widgetFullName || name;
                              $.fn[ name ] = function( options ) {
                                  var isMethodCall = typeof options === "string",
                                      args = slice.call( arguments, 1 ),
                          Severity: Minor
                          Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

                            Function init has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                init : function (scope, method, options) {
                                  Foundation.inherit(this, 'data_options');
                                  var self = this;
                            
                                  if (typeof method === 'object') {
                            Severity: Minor
                            Found in app/assets/javascripts/old/application.js - About 1 hr to fix

                              Function reposition has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  reposition : function (target, tip, classes) {
                                    var width, nub, nubHeight, nubWidth, column, objPos;
                              
                                    tip.css('visibility', 'hidden').show();
                              
                              
                              Severity: Minor
                              Found in app/assets/javascripts/old/application.js - About 1 hr to fix

                                Function reposition has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    reposition : function (target, tip, classes) {
                                      var width, nub, nubHeight, nubWidth, column, objPos;
                                
                                      tip.css('visibility', 'hidden').show();
                                
                                
                                Severity: Minor
                                Found in public/2013/assets/js/foundation/foundation.tooltip.js - About 1 hr to fix

                                  Function _optionDatepicker has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      _optionDatepicker: function(target, name, value) {
                                          var settings, date, minDate, maxDate,
                                              inst = this._getInst(target);
                                  
                                          if (arguments.length === 2 && typeof name === "string") {
                                  Severity: Minor
                                  Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

                                    Method broadcast has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      def self.broadcast(data)
                                        if data[:action_type] == "created_profile_comment"
                                          # Create the story and substory for this action,
                                          # TODO: generate notifications
                                          # and return the story.
                                    Severity: Minor
                                    Found in app/services/action.rb - About 1 hr to fix

                                      Method search has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        def search
                                          respond_to do |format|
                                            format.json do
                                              query = params.require(:query)
                                      
                                      
                                      Severity: Minor
                                      Found in app/controllers/search_controller.rb - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language