MidnightRiders/MemberPortal

View on GitHub

Showing 92 of 4,113 total issues

Function Modernizr has 605 lines of code (exceeds 25 allowed). Consider refactoring.
Open

window.Modernizr = (function( window, document, undefined ) {

    var version = '2.8.3',

    Modernizr = {},
Severity: Major
Found in app/javascript/vendor/modernizr.js - About 3 days to fix

    Function Modernizr has a Cognitive Complexity of 117 (exceeds 5 allowed). Consider refactoring.
    Open

    window.Modernizr = (function( window, document, undefined ) {
    
        var version = '2.8.3',
    
        Modernizr = {},
    Severity: Minor
    Found in app/javascript/vendor/modernizr.js - About 2 days 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

    File modernizr.js has 607 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * Modernizr v2.8.3
     * www.modernizr.com
     *
     * Copyright (c) Faruk Ates, Paul Irish, Alex Sexton
    Severity: Major
    Found in app/javascript/vendor/modernizr.js - About 1 day to fix

      Function Orbit has 257 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        var Orbit = function (el, settings) {
          // Don't reinitialize plugin
          if (el.hasClass(settings.slides_container_class)) {
            return this;
          }
      Severity: Major
      Found in app/javascript/vendor/foundation/foundation.orbit.js - About 1 day to fix

        File foundation.js has 466 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*
         * Foundation Responsive Library
         * http://foundation.zurb.com
         * Copyright 2015, ZURB
         * Free to use under the MIT license.
        Severity: Minor
        Found in app/javascript/vendor/foundation/foundation.js - About 7 hrs to fix

          File foundation.clearing.js has 462 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          ;(function ($, window, document, undefined) {
            'use strict';
          
            Foundation.libs.clearing = {
              name : 'clearing',
          Severity: Minor
          Found in app/javascript/vendor/foundation/foundation.clearing.js - About 7 hrs to fix

            File foundation.topbar.js has 454 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            (function ($, window, document, undefined) {
              'use strict';
            
              Foundation.libs.topbar = {
                name: 'topbar',
            Severity: Minor
            Found in app/javascript/vendor/foundation/foundation.topbar.js - About 6 hrs to fix

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

                  events: function (bar) {
                    var self = this,
                      S = this.S;
              
                    S(this.scope)
              Severity: Major
              Found in app/javascript/vendor/foundation/foundation.topbar.js - About 6 hrs to fix

                File foundation.orbit.js has 410 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                ;(function ($, window, document, undefined) {
                  'use strict';
                
                  var noop = function () {};
                
                
                Severity: Minor
                Found in app/javascript/vendor/foundation/foundation.orbit.js - About 5 hrs to fix

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

                      events : function () {
                        var self = this,
                            S = self.S,
                            move_class = '',
                            right_postfix = '',
                  Severity: Major
                  Found in app/javascript/vendor/foundation/foundation.offcanvas.js - About 5 hrs to fix

                    File foundation.reveal.js has 398 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    ;(function ($, window, document, undefined) {
                      'use strict';
                    
                      var openModals = [];
                    
                    
                    Severity: Minor
                    Found in app/javascript/vendor/foundation/foundation.reveal.js - About 5 hrs to fix

                      File foundation.dropdown.js has 363 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      ;(function ($, window, document, undefined) {
                        'use strict';
                      
                        Foundation.libs.dropdown = {
                          name : 'dropdown',
                      Severity: Minor
                      Found in app/javascript/vendor/foundation/foundation.dropdown.js - About 4 hrs to fix

                        File foundation.abide.js has 338 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        ;(function ($, window, document, undefined) {
                          'use strict';
                        
                          Foundation.libs.abide = {
                            name : 'abide',
                        Severity: Minor
                        Found in app/javascript/vendor/foundation/foundation.abide.js - About 4 hrs to fix

                          Function check_validation_and_apply_styles has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              check_validation_and_apply_styles : function (el_patterns) {
                                var i = el_patterns.length,
                                    validations = [];
                                if (i == 0) {
                                  return validations;
                          Severity: Major
                          Found in app/javascript/vendor/foundation/foundation.abide.js - About 3 hrs to fix

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

                                events : function (scope) {
                                  var self = this,
                                      S = self.S;
                            
                                  S(this.scope)
                            Severity: Major
                            Found in app/javascript/vendor/foundation/foundation.dropdown.js - About 3 hrs to fix

                              Method cancel has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def cancel
                                  respond_to do |format|
                                    refund = params.fetch(:refund, false).in? [true, 'true']
                                    if @membership.cancel(refund)
                                      if refund
                              Severity: Minor
                              Found in app/controllers/memberships_controller.rb - About 3 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

                              Class User has 28 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                              class User < ActiveRecord::Base
                                include Commerce::Purchaser
                              
                                IMPORTABLE_ATTRIBUTES = %w(last_name first_name last_name address city state postal_code phone email member_since username).freeze
                                CSV_ATTRIBUTES = %w(id last_name first_name address city state postal_code phone email username member_since last_sign_in_at country).freeze
                              Severity: Minor
                              Found in app/models/user.rb - About 3 hrs to fix

                                Method pick_em_button has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  def pick_em_button(pick, *args)
                                    opts = args.extract_options!
                                    user = opts[:user] || h.current_user
                                    team = model.send("#{pick}_team") if pick.in? %i(home away)
                                    html_classes = ['choice', pick == :draw ? ['secondary'] : ['primary-bg', team.abbrv.downcase]].flatten
                                Severity: Minor
                                Found in app/decorators/match_decorator.rb - About 3 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 events has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    events : function (instance) {
                                      var self = this,
                                          S = self.S;
                                
                                      self.create(this.S(instance));
                                Severity: Major
                                Found in app/javascript/vendor/foundation/foundation.tooltip.js - About 3 hrs to fix

                                  Method initialize has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    def initialize(user)
                                      alias_action :create, :read, :update, :destroy, to: :crud
                                  
                                      if user
                                        can :home, [User]
                                  Severity: Minor
                                  Found in app/models/ability.rb - About 3 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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language