MidnightRiders/MemberPortal

View on GitHub

Showing 92 of 4,113 total issues

Function open has 76 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    open : function (target, ajax_settings) {
      var self = this,
          modal;

      if (target) {
Severity: Major
Found in app/javascript/vendor/foundation/foundation.reveal.js - About 3 hrs to fix

    Function toggle_active_tab has 74 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        toggle_active_tab : function (tab, location_hash) {
          var self = this,
              S = self.S,
              tabs = tab.closest('[' + this.attr_name() + ']'),
              tab_link = tab.find('a'),
    Severity: Major
    Found in app/javascript/vendor/foundation/foundation.tab.js - About 2 hrs to fix

      Function init has 72 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          self.init = function () {
            self.build_markup();
            if (settings.timer) {
              timer = self.create_timer();
              Foundation.utils.image_loaded(this.slides().children('img'), timer.start);
      Severity: Major
      Found in app/javascript/vendor/foundation/foundation.orbit.js - About 2 hrs to fix

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

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

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

              events : function () {
                var self = this;
                $(this.scope)
                  .off('.slider')
                  .on('mousedown.fndtn.slider touchstart.fndtn.slider pointerdown.fndtn.slider',
          Severity: Major
          Found in app/javascript/vendor/foundation/foundation.slider.js - About 2 hrs to fix

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

                events : function (scope) {
                  var self = this,
                      form = self.S(scope).attr('novalidate', 'novalidate'),
                      settings = form.data(this.attr_name(true) + '-init') || {};
            
            
            Severity: Major
            Found in app/javascript/vendor/foundation/foundation.abide.js - About 2 hrs to fix

              Method initialize has 61 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def initialize(user)
                  alias_action :create, :read, :update, :destroy, to: :crud
              
                  if user
                    can :home, [User]
              Severity: Major
              Found in app/models/ability.rb - About 2 hrs to fix

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

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

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

                      open : function ($image, current, target) {
                        var self = this,
                            body = $(document.body),
                            root = target.closest('.clearing-assembled'),
                            container = self.S('div', root).first(),
                  Severity: Major
                  Found in app/javascript/vendor/foundation/foundation.clearing.js - About 2 hrs to fix

                    Function reposition has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        reposition : function (target, tip, classes) {
                          var width, nub, nubHeight, nubWidth, objPos;
                    
                          tip.css('visibility', 'hidden').show();
                    
                    
                    Severity: Major
                    Found in app/javascript/vendor/foundation/foundation.tooltip.js - About 2 hrs to fix

                      Class Membership has 21 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      class Membership < ActiveRecord::Base
                        include Commerce::Purchasable
                        include Commerce::Subscribable
                      
                        delegate :url_helpers, to: 'Rails.application.routes'
                      Severity: Minor
                      Found in app/models/membership.rb - About 2 hrs to fix

                        Function events has 54 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.reveal.js - About 2 hrs to fix

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

                              toggle: function (toggleEl) {
                                var self = this,
                                  topbar;
                          
                                if (toggleEl) {
                          Severity: Major
                          Found in app/javascript/vendor/foundation/foundation.topbar.js - About 2 hrs to fix

                            Function show has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                show : function (el, css) {
                                  // is modal
                                  if (css) {
                                    var settings = el.data(this.attr_name(true) + '-init') || this.settings,
                                        root_element = settings.root_element,
                            Severity: Major
                            Found in app/javascript/vendor/foundation/foundation.reveal.js - About 2 hrs to fix

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

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

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

                                    self._goto = function (next_idx, start_timer) {
                                      // if (locked) {return false;}
                                      if (next_idx === idx) {return false;}
                                      if (typeof timer === 'object') {timer.restart();}
                                      var slides = self.slides();
                                Severity: Minor
                                Found in app/javascript/vendor/foundation/foundation.orbit.js - About 2 hrs to fix

                                  Function data_options has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                        data_options : function (el, data_attr_name) {
                                          data_attr_name = data_attr_name || 'options';
                                          var opts = {}, ii, p, opts_arr,
                                              data_options = function (el) {
                                                var namespace = Foundation.global.namespace;
                                  Severity: Minor
                                  Found in app/javascript/vendor/foundation/foundation.js - About 1 hr to fix

                                    Function swipe_events has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        swipe_events : function (scope) {
                                          var self = this,
                                          S = self.S;
                                    
                                          S(this.scope)
                                    Severity: Minor
                                    Found in app/javascript/vendor/foundation/foundation.clearing.js - About 1 hr to fix

                                      Method sync has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                        def sync
                                          year = Date.current > Date.current.end_of_year - 15.days ? Date.current.year + 1 : Date.current.year
                                          uri = URI.parse("https://v3.football.api-sports.io/fixtures?league=253&season=#{year}")
                                          http = Net::HTTP.new(uri.host, uri.port)
                                          http.use_ssl = true
                                      Severity: Minor
                                      Found in app/controllers/matches_controller.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 Timer has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        var Timer = function (el, settings, callback) {
                                          var self = this,
                                              duration = settings.timer_speed,
                                              progress = el.find('.' + settings.timer_progress_class),
                                              start,
                                      Severity: Minor
                                      Found in app/javascript/vendor/foundation/foundation.orbit.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language