hummingbird-me/hummingbird

View on GitHub

Showing 419 of 859 total issues

Function save has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    save: function(key, val, options) {
      var attrs, method, xhr, attributes = this.attributes;

      // Handle both `"key", value` and `{key: value}` -style arguments.
      if (key == null || typeof key === 'object') {
Severity: Minor
Found in app/assets/javascripts/old/backbone-1.0.0.js - About 1 hr to fix

    Function left has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            left: function( position, data ) {
                var within = data.within,
                    withinOffset = within.offset.left + within.scrollLeft,
                    outerWidth = within.width,
                    offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
    Severity: Minor
    Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

      Function _refreshItems has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _refreshItems: function(event) {
      
              this.items = [];
              this.containers = [this];
      
      
      Severity: Minor
      Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

        Function _size has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _size: function() {
                // If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
                // divs will both have width and height set, so we need to reset them
                var nonContentHeight, minContentHeight, maxContentHeight,
                    options = this.options;
        Severity: Minor
        Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

          Function adjust has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      function adjust() {
                          var height, original;
          
                          if (mirrored !== ta) {
                              initMirror();
          Severity: Minor
          Found in app/assets/javascripts/old/jquery.autosize.js - About 1 hr to fix

            Method as_json has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def as_json
                  resource_fields = {}
                  linked = {}
                  json = {
                    title => resource_fields,
            Severity: Minor
            Found in app/serializers/api/v2/object_serialization_strategy.rb - About 1 hr to fix

              Method myanimelist has 32 lines of code (exceeds 25 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 1 hr to fix

                Method recompute_bayesian_ratings! has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def recompute_bayesian_ratings!
                      #
                      # Bayesian rating:
                      #
                      #     r * v / (v + m) + c * m / (v + m)
                Severity: Minor
                Found in app/models/concerns/bayesian_averageable.rb - About 1 hr to fix

                  Method from_library_entry has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def self.from_library_entry(l)
                      return unless l.valid?
                  
                      if l.persisted?
                  
                  
                  Severity: Minor
                  Found in app/services/action.rb - About 1 hr to fix

                    Function onTouchStart has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                    FastClick.prototype.onTouchStart = function(event) {
                        'use strict';
                        var targetElement, touch, selection;
                    
                        // Ignore multiple touches, otherwise pinch-to-zoom is prevented if both fingers are on the FastClick element (issue #111).
                    Severity: Minor
                    Found in public/2014/assets/js/fastclick.js - 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 onTouchStart has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                    FastClick.prototype.onTouchStart = function(event) {
                        'use strict';
                        var targetElement, touch, selection;
                    
                        // Ignore multiple touches, otherwise pinch-to-zoom is prevented if both fingers are on the FastClick element (issue #111).
                    Severity: Minor
                    Found in public/2013/assets/js/fastclick.js - 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

                    Method clean_desc has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def clean_desc(desc)
                        desc = Nokogiri::HTML.fragment br_to_p(desc)
                        desc.css('.spoiler').each do |x|
                          x.name = 'span'
                          x.inner_html = x.css('.spoiler_content').inner_html
                    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

                    Method data has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def data
                        if @data.nil?
                          @data = []
                    
                          # wrap+flatten+compact to ensure we get an array with no nils
                    Severity: Minor
                    Found in lib/my_anime_list_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 events has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        events : function () {
                          var self = this;
                    
                          if (Modernizr.touch) {
                            $(this.scope)
                    Severity: Minor
                    Found in public/2013/assets/js/foundation/foundation.tooltip.js - About 1 hr to fix

                      Function charCount has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        $.fn.charCount = function(options){
                          
                          // default configuration properties
                          var defaults = {  
                            allowed: 140,   
                      Severity: Minor
                      Found in app/assets/javascripts/old/charcount.js - About 1 hr to fix

                        Function initializeRatingInterface has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        this.initializeRatingInterface = function(element, type) {
                          var anime_slug, i, rating, star, _i;
                          return;
                          rating = parseInt(element.attr("data-rating"));
                          anime_slug = element.attr("data-anime-slug");
                        Severity: Minor
                        Found in app/assets/javascripts/old/library_update.js - About 1 hr to fix

                          Function events has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              events : function () {
                                var self = this;
                          
                                if (Modernizr.touch) {
                                  $(this.scope)
                          Severity: Minor
                          Found in public/2014/assets/js/foundation/foundation.tooltip.js - About 1 hr to fix

                            Function option has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                option: function( key, value ) {
                                    var options = key,
                                        parts,
                                        curOption,
                                        i;
                            Severity: Minor
                            Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

                              Function applyPlacement has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                , applyPlacement: function(offset, placement){
                                    var $tip = this.tip()
                                      , width = $tip[0].offsetWidth
                                      , height = $tip[0].offsetHeight
                                      , actualWidth
                              Severity: Minor
                              Found in app/assets/javascripts/old/bootstrap-tooltip.js - About 1 hr to fix

                                Function Duration has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function Duration(duration) {
                                        var data = this._data = {},
                                            years = duration.years || duration.year || duration.y || 0,
                                            months = duration.months || duration.month || duration.M || 0,
                                            weeks = duration.weeks || duration.week || duration.w || 0,
                                Severity: Minor
                                Found in app/assets/javascripts/old/moment.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language