MidnightRiders/MemberPortal

View on GitHub

Showing 92 of 4,113 total issues

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

    events : function (instance) {
      var self = this;
      var S = this.S;
      self.create(this.S(instance));

Severity: Minor
Found in app/javascript/vendor/foundation/foundation.accordion.js - About 1 hr to fix

    Function hide has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        hide : function (el, css) {
          // is modal
          if (css) {
            var settings = el.data(this.attr_name(true) + '-init'),
                context = this;
    Severity: Minor
    Found in app/javascript/vendor/foundation/foundation.reveal.js - About 1 hr to fix

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

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

        Function set_ui has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            set_ui : function ($handle, value) {
              var settings = $.data($handle[0], 'settings'),
                  handle_l = $.data($handle[0], 'handle_l'),
                  bar_l = $.data($handle[0], 'bar_l'),
                  norm_pct = this.normalized_percentage(value, settings.start, settings.end),
        Severity: Minor
        Found in app/javascript/vendor/foundation/foundation.slider.js - About 1 hr to fix

          Function equalize has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              equalize : function (equalizer) {
                var isStacked = false,
                    group = equalizer.data('equalizer'),
                    settings = equalizer.data(this.attr_name(true)+'-init') || this.settings,
                    vals,
          Severity: Minor
          Found in app/javascript/vendor/foundation/foundation.equalizer.js - About 1 hr to fix

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

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

                  events : function () {
                    var self = this,
                        S = this.S;
              
                    var usual_tab_behavior =  function (e, target) {
              Severity: Minor
              Found in app/javascript/vendor/foundation/foundation.tab.js - About 1 hr to fix

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

                    init: function (section, method, options) {
                      Foundation.inherit(this, 'add_custom_rule register_media throttle');
                      var self = this;
                
                      self.register_media('topbar', 'foundation-mq-topbar');
                Severity: Minor
                Found in app/javascript/vendor/foundation/foundation.topbar.js - About 1 hr to fix

                  Function _base has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        _base : function (t, s) {
                          var o_p = this.offsetParent(),
                              o = o_p.offset(),
                              p = t.offset();
                  
                  
                  Severity: Minor
                  Found in app/javascript/vendor/foundation/foundation.dropdown.js - About 1 hr to fix

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

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

                      Function is_sticky has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          is_sticky: function (topbar, topbarContainer, settings) {
                            var sticky = topbarContainer.hasClass(settings.sticky_class);
                            var smallMatch = matchMedia(Foundation.media_queries.small).matches;
                            var medMatch = matchMedia(Foundation.media_queries.medium).matches;
                            var lrgMatch = matchMedia(Foundation.media_queries.large).matches;
                      Severity: Minor
                      Found in app/javascript/vendor/foundation/foundation.topbar.js - About 1 hr to fix

                        Function close has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            close : function (modal) {
                              var modal = modal && modal.length ? modal : this.S(this.scope),
                                  open_modals = this.S('[' + this.attr_name() + '].open'),
                                  settings = modal.data(this.attr_name(true) + '-init') || this.settings,
                                  self = this;
                        Severity: Minor
                        Found in app/javascript/vendor/foundation/foundation.reveal.js - About 1 hr to fix

                          Function assemble has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              assemble: function (topbar) {
                                var self = this,
                                  settings = topbar.data(this.attr_name(true) + '-init'),
                                  section = self.S('section, .top-bar-section', topbar);
                          
                          
                          Severity: Minor
                          Found in app/javascript/vendor/foundation/foundation.topbar.js - About 1 hr to fix

                            Function webforms has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function webforms() {
                                    /*>>input*/
                                    // Run through HTML5's new input attributes to see if the UA understands any.
                                    // We're using f which is the <input> element created early on
                                    // Mike Taylr has created a comprehensive resource for testing these attributes
                            Severity: Minor
                            Found in app/javascript/vendor/modernizr.js - About 1 hr to fix

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

                                  adjust_pip : function (dropdown, target, settings, position) {
                                    var sheet = Foundation.stylesheet,
                                        pip_offset_base = 8;
                              
                                    if (dropdown.hasClass(settings.mega_class)) {
                              Severity: Minor
                              Found in app/javascript/vendor/foundation/foundation.dropdown.js - About 1 hr to fix

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

                                    resize: function () {
                                      var self = this;
                                      self.S('[' + this.attr_name() + ']').each(function () {
                                        var topbar = self.S(this),
                                          settings = topbar.data(self.attr_name(true) + '-init');
                                Severity: Minor
                                Found in app/javascript/vendor/foundation/foundation.topbar.js - About 1 hr to fix

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

                                    def index
                                      @start_date = (params[:date].try(:in_time_zone, Time.zone) || Time.current).beginning_of_week
                                      @matches = Match.unscoped.with_clubs.includes(:pick_ems).where(kickoff: (@start_date..@start_date + 7.days)).order(kickoff: :asc, location: :asc)
                                      @prev_link = "Previous #{'Game ' if @matches.empty?}Week"
                                      @next_link = "Next #{'Game ' if @matches.empty?}Week"
                                  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 build_markup has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      self.build_markup = function () {
                                        slides_container.wrap('<div class="' + settings.container_class + '"></div>');
                                        container = slides_container.parent();
                                        slides_container.addClass(settings.slides_container_class);
                                  
                                  
                                  Severity: Minor
                                  Found in app/javascript/vendor/foundation/foundation.orbit.js - About 1 hr to fix

                                    Method sync has 31 lines of code (exceeds 25 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

                                      Function injectElementWithStyles has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          injectElementWithStyles = function( rule, callback, nodes, testnames ) {
                                      
                                            var style, ret, node, docOverflow,
                                                div = document.createElement('div'),
                                                // After page load injecting a fake body doesn't work so check if body exists
                                      Severity: Minor
                                      Found in app/javascript/vendor/modernizr.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language