drhenner/ror_ecommerce

View on GitHub

Showing 346 of 346 total issues

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 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

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

                        setSelected : function(d, v, moveToMonth, dispatchEvents)
                        {
                            if (v == this.isSelected(d)) // this date is already un/selected
                            {
                                return;
            Severity: Minor
            Found in app/assets/javascripts/jquery.datePicker-2.1.2.js - About 1 hr to fix

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

                cancelInvoice : function(invoiceId) {
              
                  jQuery('#dialog').dialog( 'option',
                                            'buttons',
                                            [
              Severity: Minor
              Found in app/assets/javascripts/admin/fulfillment.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

                  Identical blocks of code found in 3 locations. Consider refactoring.
                  Open

                        if (typeof method === 'object') {
                          $.extend(true, this.settings, method);
                        } else if (typeof options !== 'undefined') {
                          $.extend(true, this.settings, options);
                        }
                  Severity: Major
                  Found in app/assets/javascripts/foundation/foundation.tooltips.js and 2 other locations - About 1 hr to fix
                  app/assets/javascripts/foundation/foundation.reveal.js on lines 42..46
                  app/assets/javascripts/foundation/foundation.topbar.js on lines 26..30

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 61.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 3 locations. Consider refactoring.
                  Open

                        if (typeof method === 'object') {
                          $.extend(true, this.settings, method);
                        } else if (typeof options !== 'undefined') {
                          $.extend(true, this.settings, options);
                        }
                  Severity: Major
                  Found in app/assets/javascripts/foundation/foundation.topbar.js and 2 other locations - About 1 hr to fix
                  app/assets/javascripts/foundation/foundation.reveal.js on lines 42..46
                  app/assets/javascripts/foundation/foundation.tooltips.js on lines 31..35

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 61.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 3 locations. Consider refactoring.
                  Open

                        if (typeof method === 'object') {
                          $.extend(true, this.settings, method);
                        } else if (typeof options !== 'undefined') {
                          $.extend(true, this.settings, options);
                        }
                  Severity: Major
                  Found in app/assets/javascripts/foundation/foundation.reveal.js and 2 other locations - About 1 hr to fix
                  app/assets/javascripts/foundation/foundation.tooltips.js on lines 31..35
                  app/assets/javascripts/foundation/foundation.topbar.js on lines 26..30

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 61.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                      hide : function (el, css) {
                        // is modal
                        if (css) {
                          if (/pop/i.test(this.settings.animation)) {
                            var end_css = {
                  Severity: Minor
                  Found in app/assets/javascripts/foundation/foundation.reveal.js - About 1 hr to fix

                    Function build_markup has 32 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/assets/javascripts/foundation/foundation.orbit.js - About 1 hr to fix

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

                                  setDisplayedMonth : function(m, y, rerender)
                                  {
                                      if (this.startDate == undefined || this.endDate == undefined) {
                                          return;
                                      }
                      Severity: Minor
                      Found in app/assets/javascripts/jquery.datePicker-2.1.2.js - About 1 hr to fix

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

                          captureInvoice : function(invoiceId) {
                            jQuery('#dialog').dialog( 'option',
                                                      'buttons',
                                                      [
                                                        {
                        Severity: Minor
                        Found in app/assets/javascripts/admin/fulfillment.js - About 1 hr to fix

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

                                function build(string) {
                                  var openWith      = prepare(clicked.openWith);
                                  var placeHolder     = prepare(clicked.placeHolder);
                                  var replaceWith     = prepare(clicked.replaceWith);
                                  var closeWith       = prepare(clicked.closeWith);
                          Severity: Minor
                          Found in app/assets/javascripts/markitup/jquery.markitup.js - About 1 hr to fix

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

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

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

                              $.fn.formToArray = function(semantic) {
                                  var a = [];
                                  if (this.length == 0) return a;
                              
                                  var form = this[0];
                              Severity: Minor
                              Found in app/assets/javascripts/jqwizard/jquery.form.js - About 1 hr to fix

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                            if (Foundation.rtl) {
                                              leftOffset = this.settings.$target.offset().width - this.settings.$next_tip.width() + leftOffset;
                                            }
                                Severity: Major
                                Found in app/assets/javascripts/foundation/foundation.joyride.js and 1 other location - About 1 hr to fix
                                app/assets/javascripts/foundation/foundation.joyride.js on lines 442..444

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 60.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                      target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
                                Severity: Major
                                Found in app/assets/javascripts/chosen/chosen.jquery.js and 1 other location - About 1 hr to fix
                                app/assets/javascripts/chosen/chosen.jquery.js on lines 575..575

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 60.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Severity
                                Category
                                Status
                                Source
                                Language