hummingbird-me/hummingbird

View on GitHub

Showing 419 of 859 total issues

Function eq has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  var eq = function(a, b, aStack, bStack) {
    // Identical objects are equal. `0 === -0`, but they aren't identical.
    // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.
    if (a === b) return a !== 0 || 1 / a == 1 / b;
    // A strict comparison is necessary because `null == undefined`.
Severity: Major
Found in app/assets/javascripts/old/underscore-1.4.4.js - About 2 hrs to fix

    Function _generatePosition has 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _generatePosition: function(event) {
    
            var containment, co, top, left,
                o = this.options,
                scroll = this.cssPosition === "absolute" && !( this.scrollParent[ 0 ] !== document && $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? this.offsetParent : this.scrollParent,
    Severity: Major
    Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 2 hrs to fix

      File garlic.js has 263 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
        Garlic.js allows you to automatically persist your forms' text field values locally,
        until the form is submitted. This way, your users don't lose any precious data if they
        accidentally close their tab or browser.
      
      
      Severity: Minor
      Found in app/assets/javascripts/old/garlic.js - About 2 hrs to fix

        Function keydown has 57 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                keydown: function( event ) {
                    /*jshint maxcomplexity:25*/
                    var allowed, curVal, newVal, step,
                        index = $( event.target ).data( "ui-slider-handle-index" );
        
        
        Severity: Major
        Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 2 hrs to fix

          Function _generateMonthYearHeader has 56 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
                      secondary, monthNames, monthNamesShort) {
          
                  var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
                      changeMonth = this._get(inst, "changeMonth"),
          Severity: Major
          Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 2 hrs to fix

            Method find_by_ids has 56 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def self.find_by_ids(story_ids, current_user)
                stories = Story.where(id: story_ids)
                          .for_user(current_user)
                          .preload(:target, substories: %i(target))
                          .includes(:user, :substories,
            Severity: Major
            Found in lib/story_query.rb - About 2 hrs to fix

              File bootstrap-tooltip.js has 258 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /* ===========================================================
               * bootstrap-tooltip.js v2.3.2
               * http://twitter.github.com/bootstrap/javascript.html#tooltips
               * Inspired by the original jQuery.tipsy by Jason Frame
               * ===========================================================
              Severity: Minor
              Found in app/assets/javascripts/old/bootstrap-tooltip.js - About 2 hrs to fix

                File anime.rb has 258 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                class Anime < ActiveRecord::Base
                  PG_TITLE_SCOPE = %i(title alt_title)
                
                  AGE_RATINGS = %w(G PG13 PG R18+)
                
                
                Severity: Minor
                Found in app/models/anime.rb - About 2 hrs to fix

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

                      refresh: function(init) {
                        var el = this.element;
                        var o = this.options;
                        var menu = this.menu;
                        var checkboxContainer = this.checkboxContainer;
                  Severity: Major
                  Found in app/assets/javascripts/old/multiselect.js - About 2 hrs to fix

                    Function _mouseStart has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        _mouseStart: function(event) {
                            var that = this,
                                options = this.options;
                    
                            this.opos = [event.pageX, event.pageY];
                    Severity: Major
                    Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 2 hrs to fix

                      Method create_or_update_from_hash has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def self.create_or_update_from_hash hash
                          # First the creation logic
                          # TODO: stop hard-coding the ID column
                          manga = Manga.find_by(mal_id: hash[:external_id])
                          if manga.nil? && Manga.where(romaji_title: hash[:romaji_title]).count > 1
                      Severity: Minor
                      Found in app/models/manga.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

                      Method myanimelist has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def myanimelist
                          file = params.require(:file)
                      
                          # Prepare the file
                          # Check the magic number for gzip because some browsers are stupid
                      Severity: Minor
                      Found in app/controllers/settings/import_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 keydown has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  keydown: function( event ) {
                                      /*jshint maxcomplexity:15*/
                                      if ( this.element.prop( "readOnly" ) ) {
                                          suppressKeyPress = true;
                                          suppressInput = true;
                      Severity: Major
                      Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 2 hrs to fix

                        Function _refreshValue has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            _refreshValue: function() {
                                var lastValPercent, valPercent, value, valueMin, valueMax,
                                    oRange = this.options.range,
                                    o = this.options,
                                    that = this,
                        Severity: Major
                        Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 2 hrs to fix

                          Function _processTabs has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              _processTabs: function() {
                                  var that = this;
                          
                                  this.tablist = this._getList()
                                      .addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
                          Severity: Major
                          Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 2 hrs to fix

                            Function onTouchEnd has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            FastClick.prototype.onTouchEnd = function(event) {
                                'use strict';
                                var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement;
                            
                                if (!this.trackingClick) {
                            Severity: Major
                            Found in public/2013/assets/js/fastclick.js - About 2 hrs to fix

                              Function onTouchEnd has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              FastClick.prototype.onTouchEnd = function(event) {
                                  'use strict';
                                  var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement;
                              
                                  if (!this.trackingClick) {
                              Severity: Major
                              Found in public/2014/assets/js/fastclick.js - About 2 hrs to fix

                                Method apply! has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  def apply!
                                    table = (list == "manga") ? Manga : Anime
                                    media_list = table.where(mal_id: data.map {|x| x[:mal_id] }).index_by(&:mal_id)
                                    failures = []
                                    count = 0
                                Severity: Major
                                Found in lib/my_anime_list_import.rb - About 2 hrs to fix

                                  Function _touchMove has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  Flipsnap.prototype._touchMove = function(event) {
                                    var self = this;
                                  
                                    if (!self.scrolling || gestureStart) {
                                      return;
                                  Severity: Minor
                                  Found in public/2013/assets/js/flipsnap.js - About 2 hrs to fix

                                    Function _touchMove has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    Flipsnap.prototype._touchMove = function(event) {
                                      var self = this;
                                    
                                      if (!self.scrolling || gestureStart) {
                                        return;
                                    Severity: Minor
                                    Found in public/2014/assets/js/flipsnap.js - About 2 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language