hummingbird-me/hummingbird

View on GitHub

Showing 419 of 859 total issues

Function graphData has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  graphData: function() {
    var data = this.get('model'),
        labels = Object.keys(data["registrations"]["total"]),
        confirmed = [],
        total = [];
Severity: Minor
Found in frontend/app/controllers/kotodama.js - About 1 hr to fix

    Function refresh has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        refresh: function() {
            //See #8237 & #8828
            var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
    
            if ( isDisabled !== this.options.disabled ) {
    Severity: Minor
    Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

      Function _setupHeightStyle has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _setupHeightStyle: function( heightStyle ) {
              var maxHeight,
                  parent = this.element.parent();
      
              if ( heightStyle === "fill" ) {
      Severity: Minor
      Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

        Function performSearch has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          performSearch: function() {
            if (this.get('loading')) {
              Ember.run.later(this, this.performSearch, 100);
              return;
            }
        Severity: Minor
        Found in frontend/app/controllers/onboarding/library.js - About 1 hr to fix

          Method stats has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def stats
              stats = {}
          
              stats[:activeaccs] = User.where('last_library_update >= ?', 1.day.ago).count
              stats[:feedposts] = Story.where('created_at >= ?', 1.day.ago).count
          Severity: Minor
          Found in app/controllers/admin_controller.rb - About 1 hr to fix

            Function exports has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function(environment) {
              var ENV = {
                modulePrefix: 'frontend',
                environment: environment,
                baseURL: '/',
            Severity: Minor
            Found in frontend/config/environment.js - About 1 hr to fix

              Function retrieve has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  , retrieve: function () {
                    if ( this.storage.has( this.path ) ) {
              
                      // if data expired, destroy it!
                      if ( this.options.expires ) {
              Severity: Minor
              Found in app/assets/javascripts/old/garlic.js - About 1 hr to fix

                Function equals has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  equals: function(other) {
                    var len = this.opcodes.length;
                    if (other.opcodes.length !== len) {
                      return false;
                    }
                Severity: Minor
                Found in app/assets/javascripts/old/handlebars-1.0.0.js - About 1 hr to fix

                  Function block has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    block: function(block) {
                      var mustache = block.mustache,
                          program = block.program,
                          inverse = block.inverse;
                  
                  
                  Severity: Minor
                  Found in app/assets/javascripts/old/handlebars-1.0.0.js - About 1 hr to fix

                    Function focus has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        focus: function( event, item ) {
                            var nested, focused;
                            this.blur( event, event && event.type === "focus" );
                    
                            this._scrollIntoView( item );
                    Severity: Minor
                    Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

                      Function _mouseStop has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          _mouseStop: function(event) {
                      
                              this.resizing = false;
                              var pr, ista, soffseth, soffsetw, s, left, top,
                                  o = this.options, that = this;
                      Severity: Minor
                      Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

                        Function resize has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            resize: function (event, ui) {
                                var that = $(this).data("ui-resizable"),
                                    o = that.options,
                                    os = that.originalSize,
                                    op = that.originalPosition,
                        Severity: Minor
                        Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

                          Function create has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              create: function() {
                                var group = this.store.createRecord('group', {
                                  name: this.get('name'),
                                  bio: this.get('bio'),
                                  about: this.get('about')
                          Severity: Minor
                          Found in frontend/app/controllers/modals/create-group.js - About 1 hr to fix

                            Consider simplifying this complex logical expression.
                            Open

                                    if ($.datepicker._datepickerShowing) {
                                        switch (event.keyCode) {
                                            case 9: $.datepicker._hideDatepicker();
                                                    handled = false;
                                                    break; // hide on tab out
                            Severity: Major
                            Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

                              Function _generateMonthYearHeader has 8 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
                                          secondary, monthNames, monthNamesShort) {
                              Severity: Major
                              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.options.revert === "invalid" && !dropped) || (this.options.revert === "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
                                            $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
                                                if(that._trigger("stop", event) !== false) {
                                                    that._clear();
                                                }
                                Severity: Major
                                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(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
                                                  (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
                                              }
                                  Severity: Major
                                  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.options.tolerance === "pointer" ||
                                                this.options.forcePointerForContainers ||
                                                (this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > item[this.floating ? "width" : "height"])
                                            ) {
                                                return isOverElement;
                                    Severity: Major
                                    Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

                                      Method add! has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                        def add!(story)
                                          add_story = false
                                          if story.story_type == "comment"
                                            if story.group_id || @user == story.target || @user.following.include?(story.target)
                                              add_story = true
                                      Severity: Minor
                                      Found in app/services/news_feed.rb - About 55 mins 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 alternate_title has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                        def alternate_title(preference = '')
                                          if preference.class == User
                                            preference = preference.title_language_preference
                                          end
                                      
                                      
                                      Severity: Minor
                                      Found in app/models/anime.rb - About 55 mins 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