hummingbird-me/hummingbird

View on GitHub

Showing 419 of 859 total issues

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

    function str(key, holder) {

// Produce a string from holder[key].

        var i,          // The loop counter.
Severity: Major
Found in app/assets/javascripts/old/json2.js - About 2 hrs to fix

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

        _contactContainers: function(event) {
            var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, base, cur, nearBottom, floating,
                innermostContainer = null,
                innermostIndex = null;
    
    
    Severity: Major
    Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 2 hrs to fix

      Function FastClick has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

      function FastClick(layer) {
          'use strict';
          var oldOnClick, self = this;
      
      
      
      Severity: Minor
      Found in public/2013/assets/js/fastclick.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 FastClick has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

      function FastClick(layer) {
          'use strict';
          var oldOnClick, self = this;
      
      
      
      Severity: Minor
      Found in public/2014/assets/js/fastclick.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 apply_filters has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

        def apply_filters(anime)
          anime = anime.full_search(name) unless name.nil?
          anime = anime.where(slug: id) unless id.nil?
          anime = anime.where(show_type: show_type) unless show_type.nil?
          anime = anime.by_genres(genres) unless genres.nil?
      Severity: Minor
      Found in app/services/anime_search.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 present_story has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          def present_story(story, current_user, title_language_preference)
            json = {
              id: story.id,
              story_type: story.story_type,
              user: present_miniuser(story.user),
      Severity: Minor
      Found in app/api/api_v1.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 _open has 67 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _open: function( event, target, content ) {
              var tooltip, events, delayedShow,
                  positionOption = $.extend( {}, this.options.position );
      
              if ( !content ) {
      Severity: Major
      Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 2 hrs to fix

        Consider simplifying this complex logical expression.
        Open

            } else if (typeof options == 'object' || !options) {
        
              // Check if any options were passed
              var settings = $.extend({
                  checkedClass: _checked,
        Severity: Critical
        Found in app/assets/javascripts/old/jquery.icheck.js - About 2 hrs to fix

          Function AwesomeRating has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

          $.fn.AwesomeRating = function(options) {
            return this.each(function() {
              var i, icon, rating, widget, _i, _len, _ref, _results;
              widget = this;
              rating = $(widget).attr("data-rating");
          Severity: Minor
          Found in app/assets/javascripts/old/awesome_rating.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 notNeeded has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

          FastClick.notNeeded = function(layer) {
              'use strict';
              var metaViewport;
              var chromeVersion;
          
          
          Severity: Minor
          Found in public/2014/assets/js/fastclick.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 notNeeded has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

          FastClick.notNeeded = function(layer) {
              'use strict';
              var metaViewport;
              var chromeVersion;
          
          
          Severity: Minor
          Found in public/2013/assets/js/fastclick.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 filter_old has 64 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def filter_old
              hide_cover_image
              @filter_years = %w(Upcoming 2010s 2000s 1990s 1980s 1970s Older)
          
              if params[:g]
          Severity: Major
          Found in app/controllers/anime_controller.rb - About 2 hrs to fix

            Method sanitize_review has 63 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def sanitize_review(html)
                allow_youtube_transformer = lambda do |env|
                  node      = env[:node]
                  node_name = env[:node_name]
            
            
            Severity: Major
            Found in app/helpers/reviews_helper.rb - About 2 hrs to fix

              Function _init has 62 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function _init(){
                      /* Check if browser supports localStorage */
                      var localStorageReallyWorks = false;
                      if("localStorage" in window){
                          try {
              Severity: Major
              Found in app/assets/javascripts/old/jstorage.js - About 2 hrs to fix

                Function _showDatepicker has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    _showDatepicker: function(input) {
                        input = input.target || input;
                        if (input.nodeName.toLowerCase() !== "input") { // find from button/image trigger
                            input = $("input", input.parentNode)[0];
                        }
                Severity: Major
                Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 2 hrs to fix

                  Function FastClick has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function FastClick(layer) {
                      'use strict';
                      var oldOnClick, self = this;
                  
                  
                  
                  Severity: Major
                  Found in public/2014/assets/js/fastclick.js - About 2 hrs to fix

                    Function FastClick has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function FastClick(layer) {
                        'use strict';
                        var oldOnClick, self = this;
                    
                    
                    
                    Severity: Major
                    Found in public/2013/assets/js/fastclick.js - About 2 hrs to fix

                      Function drag has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          drag: function(event, ui) {
                      
                              var inst = $(this).data("ui-draggable"), that = this;
                      
                              $.each(inst.sortables, function() {
                      Severity: Major
                      Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 2 hrs to fix

                        Function drag has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            drag: function(event, ui) {
                        
                                var ts, bs, ls, rs, l, r, t, b, i, first,
                                    inst = $(this).data("ui-draggable"),
                                    o = inst.options,
                        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 60 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def self.create_or_update_from_hash(hash)
                              # First the creation logic
                              # TODO: stop hard-coding the ID column
                              anime = Anime.find_by(mal_id: hash[:external_id])
                              if anime.nil? && Anime.where(title: hash[:title][:canonical]).count > 1
                          Severity: Major
                          Found in app/models/anime.rb - About 2 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language