calblueprint/ashby-village

View on GitHub

Showing 25 of 51 total issues

File jquery.joyride-2.1.js has 726 lines of code (exceeds 250 allowed). Consider refactoring.
Open

  /*
 * jQuery Foundation Joyride Plugin 2.1
 * http://foundation.zurb.com
 * Copyright 2013, ZURB
 * Free to use under the MIT license.
Severity: Major
Found in app/assets/javascripts/jquery.joyride-2.1.js - About 1 day to fix

    Function mask has 141 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        mask: function(mask, settings) {
          var input, defs, tests, partialPosition, firstNonMaskPos, lastRequiredNonMaskPos, len, oldVal;
          if (!mask && this.length > 0) {
            input = $(this[0]);
            var fn = input.data($.mask.dataName);
    Severity: Major
    Found in app/assets/javascripts/jquery.maskedinput.js - About 5 hrs to fix

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

            init : function (opts) {
              return this.each(function () {
      
                if ($.isEmptyObject(settings)) {
                  settings = $.extend(true, defaults, opts);
      Severity: Major
      Found in app/assets/javascripts/jquery.joyride-2.1.js - About 3 hrs to fix

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

              show : function (init) {
                var opts = {}, ii, opts_arr = [], opts_len = 0, p,
                    $timer = null;
        
                // are we paused?
        Severity: Major
        Found in app/assets/javascripts/jquery.joyride-2.1.js - About 2 hrs to fix

          Function ready_groups_index has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var ready_groups_index = function() {
            updateListing();
            $(".inactive").hide();
            updateGroupCount();
          
          
          Severity: Major
          Found in app/assets/javascripts/groups_index.js - About 2 hrs to fix

            Function ready_groups_index has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

            var ready_groups_index = function() {
              updateListing();
              $(".inactive").hide();
              updateGroupCount();
            
            
            Severity: Minor
            Found in app/assets/javascripts/groups_index.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 pos_default has 54 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  pos_default : function (init) {
                    var half_fold = Math.ceil(settings.$window.height() / 2),
                        tip_position = settings.$next_tip.offset(),
                        $nub = $('.joyride-nub', settings.$next_tip),
                        nub_width = Math.ceil($nub.outerWidth() / 2),
            Severity: Major
            Found in app/assets/javascripts/jquery.joyride-2.1.js - About 2 hrs to fix

              Function expose has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    expose: function(){
                      var expose,
                        exposeCover,
                        el,
                        origCSS,
              Severity: Major
              Found in app/assets/javascripts/jquery.joyride-2.1.js - About 2 hrs to fix

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

                      un_expose: function(){
                        var exposeId,
                          el,
                          expose ,
                          origCSS,
                Severity: Minor
                Found in app/assets/javascripts/jquery.joyride-2.1.js - About 1 hr to fix

                  Method create has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def create
                      build_resource(sign_up_params)
                  
                      resource.save
                      yield resource if block_given?
                  Severity: Minor
                  Found in app/controllers/users/registrations_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 pos_phone has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        pos_phone : function (init) {
                          var tip_height = settings.$next_tip.outerHeight(),
                              tip_offset = settings.$next_tip.offset(),
                              target_height = settings.$target.outerHeight(),
                              $nub = $('.joyride-nub', settings.$next_tip),
                  Severity: Minor
                  Found in app/assets/javascripts/jquery.joyride-2.1.js - About 1 hr to fix

                    Function ready_groups_show has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    var ready_groups_show = function() {
                      $(".false").hide();
                    
                      function menu_clicked(event) { 
                        // unselected others
                    Severity: Minor
                    Found in app/assets/javascripts/groups_show.js - About 1 hr to fix

                      Method notifications has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def notifications
                          @group = Group.find(params[:id])
                          @user_group = current_user.user_groups.where(group_id: @group.id).first
                          if @user_group && @user_group.group_email_notifications
                            @email_notif = @user_group.group_email_notifications
                      Severity: Minor
                      Found in app/controllers/groups_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

                      Consider simplifying this complex logical expression.
                      Open

                                if (!input.prop("readonly")) {
                                  var pos, begin, end, k = e.which || e.keyCode;
                                  oldVal = input.val(), 8 === k || 46 === k || iPhone && 127 === k ? (pos = input.caret(),
                                  begin = pos.begin, end = pos.end, end - begin === 0 && (begin = 46 !== k ? seekPrev(begin) : end = seekNext(begin - 1),
                                  end = 46 === k ? seekNext(end) : end), clearBuffer(begin, end), shiftL(begin, end - 1),
                      Severity: Major
                      Found in app/assets/javascripts/jquery.maskedinput.js - About 1 hr to fix

                        Method update_organizers has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def update_organizers(current_user, organizers)
                            @event_organizers = [current_user]
                            if organizers
                              @event_organizers.concat(User.find(organizers))
                            end
                        Severity: Minor
                        Found in app/models/event.rb - About 55 mins 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 create has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def create
                            @group = Group.new(group_params)
                            if @group.save
                              if !params[:selected_leaders].blank?
                                @users = User.find(params[:selected_leaders].split(","))
                        Severity: Minor
                        Found in app/controllers/groups_controller.rb - About 45 mins 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 resize_navbar has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                        var resize_navbar = function() {
                          if($(window).width() < 640){
                            $(".dropdown").children().each(function(index) {
                              if(index > 1){
                                $(".dropdown").parent().parent()[0].appendChild($(this)[0]);
                        Severity: Minor
                        Found in app/assets/javascripts/navbar.js - About 45 mins 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

                        Avoid deeply nested control flow statements.
                        Open

                                      if (settings.timer > 0) {
                        
                                        settings.$next_tip.fadeIn(settings.tipAnimationFadeSpeed);
                        
                                        settings.$next_tip.show();
                        Severity: Major
                        Found in app/assets/javascripts/jquery.joyride-2.1.js - About 45 mins to fix

                          Consider simplifying this complex logical expression.
                          Open

                                      if (!(e.ctrlKey || e.altKey || e.metaKey || 32 > k) && k && 13 !== k) {
                                        if (pos.end - pos.begin !== 0 && (clearBuffer(pos.begin, pos.end), shiftL(pos.begin, pos.end - 1)),
                                        p = seekNext(pos.begin - 1), len > p && (c = String.fromCharCode(k), tests[p].test(c))) {
                                          if (shiftR(p), buffer[p] = c, writeBuffer(), next = seekNext(p), android) {
                                            var proxy = function() {
                          Severity: Major
                          Found in app/assets/javascripts/jquery.maskedinput.js - About 40 mins to fix

                            Function ready_error has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                            var ready_error = function() {
                              if ($('.flash_error').length > 0) {
                                var error = $('.flash_error').html();
                                if (error.indexOf("sign_in") > -1 ) {
                                  $('#login').foundation('reveal', 'open');
                            Severity: Minor
                            Found in app/assets/javascripts/application.js - About 35 mins 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