drhenner/ror_ecommerce

View on GitHub

Showing 203 of 346 total issues

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

    rules: function(command, argument) {
        var element = this[0];
        
        if (command) {
            var settings = $.data(element.form, 'validator').settings;
Severity: Minor
Found in app/assets/javascripts/jqwizard/jquery.validate.js - About 1 hr to fix

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

        reposition : function (target, tip, classes) {
          var width, nub, nubHeight, nubWidth, column, objPos;
    
          tip.css('visibility', 'hidden').show();
    
    
    Severity: Minor
    Found in app/assets/javascripts/foundation/foundation.tooltips.js - About 1 hr to fix

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

          init : function (scope, method, options) {
            Foundation.inherit(this, 'data_options');
            var self = this;
      
            if (typeof method === 'object') {
      Severity: Minor
      Found in app/assets/javascripts/foundation/foundation.tooltips.js - About 1 hr to fix

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

            function add(value, text, callHandler) {
                $option = null;
        
                if ($(value).is('option')) {
                    $option = $(value);
        Severity: Minor
        Found in app/assets/javascripts/jquery.selectlist.js - About 1 hr to fix

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

              events : function () {
                var self = this;
          
                $(this.scope)
                  .on('click.joyride', '.joyride-next-tip, .joyride-modal-bg', function (e) {
          Severity: Minor
          Found in app/assets/javascripts/foundation/foundation.joyride.js - About 1 hr to fix

            Function results_build has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                Chosen.prototype.results_build = function() {
                  var content, data, _i, _len, _ref;
                  this.parsing = true;
                  this.results_data = root.SelectParser.select_to_array(this.form_field);
                  if (this.is_multiple && this.choices > 0) {
            Severity: Minor
            Found in app/assets/javascripts/chosen/chosen.jquery.js - About 1 hr to fix

              Function _next has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      _next : function(){
                          if(this.options.validationEnabled){
                              if(!this.element.valid()){
                                  this.element.validate().focusInvalid();
                                  return false;
              Severity: Minor
              Found in app/assets/javascripts/jqwizard/jquery.form.wizard.js - About 1 hr to fix

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

                  $.fn.anim = function(properties, duration, ease, callback){
                    var key, cssValues = {}, cssProperties, transforms = '',
                        that = this, wrappedCallback, endEvent = $.fx.transitionEnd
                
                    if (duration === undefined) duration = 0.4
                Severity: Minor
                Found in app/assets/javascripts/zepto.js - About 1 hr to fix

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

                      start : function () {
                        var self = this,
                            $this = $(this.scope).find('[data-joyride]'),
                            integer_settings = ['timer', 'scrollSpeed', 'startOffset', 'tipAnimationFadeSpeed', 'cookieExpires'],
                            int_settings_count = integer_settings.length;
                  Severity: Minor
                  Found in app/assets/javascripts/foundation/foundation.joyride.js - About 1 hr to fix

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

                        swipe_events : function () {
                          var self = this;
                    
                          $(this.scope)
                            .on('touchstart.fndtn.clearing', '.visible-img', function(e) {
                    Severity: Minor
                    Found in app/assets/javascripts/foundation/foundation.clearing.js - About 1 hr to fix

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

                        def index
                          #  The index action should
                          if u = User.first
                            redirect_to root_url and return if !current_user
                            redirect_to root_url unless current_user.admin?
                      Severity: Minor
                      Found in app/controllers/admin/overviews_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 setDimentionsFromLargestSlide has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          setDimentionsFromLargestSlide: function () {
                            //Collect all slides and set slider size of largest image
                            var self = this,
                                $fluidPlaceholder;
                      
                      
                      Severity: Minor
                      Found in app/assets/javascripts/admin/jquery.orbit-1.4.0.js - About 1 hr to fix

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

                            events : function () {
                              var self = this;
                        
                              $(this.scope)
                                .on('click.fndtn.dropdown', '[data-dropdown]', function (e) {
                        Severity: Minor
                        Found in app/assets/javascripts/foundation/foundation.dropdown.js - About 1 hr to fix

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

                              reposition : function (target, tip, classes) {
                                var width, nub, nubHeight, nubWidth, row, objPos;
                          
                                width = target.data('width');
                                nub = tip.children('.nub');
                          Severity: Minor
                          Found in app/assets/javascripts/admin/jquery.tooltips.js - About 1 hr to fix

                            Method update has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def update
                                @order = find_or_create_order
                                @order.ip_address = request.remote_ip
                            
                                @credit_card ||= ActiveMerchant::Billing::CreditCard.new(cc_params)
                            Severity: Minor
                            Found in app/controllers/shopping/orders_controller.rb - About 1 hr to fix

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

                                      check: function( element ) {
                                          element = this.clean( element );
                                          
                                          // if radio/checkbox, validate first element in group instead
                                          if (this.checkable(element)) {
                              Severity: Minor
                              Found in app/assets/javascripts/jqwizard/jquery.validate.js - About 1 hr to fix

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

                                    setCaption: function () {
                                      var captionLocation = this.currentSlide().attr('data-caption'),
                                          captionHTML;
                                
                                      if (!this.options.captions) {
                                Severity: Minor
                                Found in app/assets/javascripts/admin/jquery.orbit-1.4.0.js - About 1 hr to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                        if (this.nodeName.toLowerCase() != 'fieldset' &&
                                          !this.disabled && type != 'submit' && type != 'reset' && type != 'button' &&
                                          ((type != 'radio' && type != 'checkbox') || this.checked))
                                          result.push({
                                            name: el.attr('name'),
                                  Severity: Critical
                                  Found in app/assets/javascripts/zepto.js - About 1 hr to fix

                                    Function keyup_checker has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        AbstractChosen.prototype.keyup_checker = function(evt) {
                                          var stroke, _ref;
                                          stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
                                          this.search_field_scale();
                                          switch (stroke) {
                                    Severity: Minor
                                    Found in app/assets/javascripts/chosen/chosen.jquery.js - About 1 hr to fix

                                      Function detect has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        function detect(ua){
                                          var os = this.os = {}, browser = this.browser = {},
                                            webkit = ua.match(/WebKit\/([\d.]+)/),
                                            android = ua.match(/(Android)\s+([\d.]+)/),
                                            ipad = ua.match(/(iPad).*OS\s([\d_]+)/),
                                      Severity: Minor
                                      Found in app/assets/javascripts/zepto.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language