drhenner/ror_ecommerce

View on GitHub

Showing 346 of 346 total issues

Function attr has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

jQuery.attr = function( elem, name, value, pass ) {
  var lowerName = name.toLowerCase(),
    nType = elem && elem.nodeType;

  if ( pass ) {
Severity: Minor
Found in app/assets/javascripts/jquery/jquery-migrate-1.1.1.js - About 1 hr to fix

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

        init: function (element, options) {
          var $imageSlides,
              imagesLoadedCount = 0,
              self = this;
    
    
    Severity: Minor
    Found in app/assets/javascripts/admin/jquery.orbit-1.4.0.js - About 1 hr to fix

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

          show : function (el, css) {
            // is modal
            if (css) {
              if (el.parent('body').length === 0) {
                var placeholder = el.wrap('<div style="display: none;" />').parent();
      Severity: Minor
      Found in app/assets/javascripts/foundation/foundation.reveal.js - About 1 hr to fix

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

          $.fn.on = function(event, selector, callback){
            return !selector || $.isFunction(selector) ?
              this.bind(event, selector || callback) : this.delegate(selector, event, callback)
          }
        Severity: Major
        Found in app/assets/javascripts/zepto.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/zepto.js on lines 1055..1058

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

        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

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

                            if (this.horizontalPosition == $.dpConst.POS_RIGHT) {
                                $pop.css('left', eleOffset.left + $ele.width() - $pop.width() + c.horizontalOffset);
                            }
        Severity: Major
        Found in app/assets/javascripts/jquery.datePicker-2.1.2.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/jquery.datePicker-2.1.2.js on lines 822..824

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

        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

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

                            if (this.verticalPosition == $.dpConst.POS_BOTTOM) {
                                $pop.css('top', eleOffset.top + $ele.height() - $pop.height() + c.verticalOffset);
                            }
        Severity: Major
        Found in app/assets/javascripts/jquery.datePicker-2.1.2.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/jquery.datePicker-2.1.2.js on lines 825..827

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

        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

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

          $.fn.off = function(event, selector, callback){
            return !selector || $.isFunction(selector) ?
              this.unbind(event, selector || callback) : this.undelegate(selector, event, callback)
          }
        Severity: Major
        Found in app/assets/javascripts/zepto.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/zepto.js on lines 1051..1054

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

        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

                    if (!modalQueued) {
                      modalBg.delay(options.animationSpeed).fadeOut(options.animationSpeed, function () {
                        modal.trigger('reveal:closed');
                      });
                    } else {
        Severity: Major
        Found in app/assets/javascripts/admin/jquery.reveal.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/admin/jquery.reveal.js on lines 109..115

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

        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

                    if (!modalQueued) {
                      modalBg.delay(options.animationSpeed).fadeOut(options.animationSpeed, function () {
                        modal.trigger('reveal:closed');
                      });
                    } else {
        Severity: Major
        Found in app/assets/javascripts/admin/jquery.reveal.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/admin/jquery.reveal.js on lines 124..130

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

        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 register_observers has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            Chosen.prototype.register_observers = function() {
              this.container.mousedown(__bind(function(evt) {
                return this.container_mousedown(evt);
              }, this));
              this.container.mouseup(__bind(function(evt) {
        Severity: Minor
        Found in app/assets/javascripts/chosen/chosen.jquery.js - About 1 hr to fix

          Function closeAnimation has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                function closeAnimation() {
                  if (!locked) {
                    lockModal();
                    modal.removeClass("open");
                    if (options.animation === "fadeAndPop") {
          Severity: Minor
          Found in app/assets/javascripts/admin/jquery.reveal.js - About 1 hr to fix

            Function _goto has 41 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 = slides_container.children();
            Severity: Minor
            Found in app/assets/javascripts/foundation/foundation.orbit.js - About 1 hr to fix

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

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

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

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

                      open : function (target, ajax_settings) {
                        if (target) {
                          if (typeof target.selector !== 'undefined') {
                            var modal = $('#' + target.data('reveal-id'));
                          } else {
                  Severity: Minor
                  Found in app/assets/javascripts/foundation/foundation.reveal.js - About 1 hr to fix

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

                              var data = {
                                    start_page_x: e.touches[0].pageX,
                                    start_page_y: e.touches[0].pageY,
                                    start_time: (new Date()).getTime(),
                                    delta_x: 0,
                    Severity: Major
                    Found in app/assets/javascripts/foundation/foundation.clearing.js and 1 other location - About 1 hr to fix
                    app/assets/javascripts/foundation/foundation.orbit.js on lines 217..223

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

                    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

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

                              var data = {
                                start_page_x: e.touches[0].pageX,
                                start_page_y: e.touches[0].pageY,
                                start_time: (new Date()).getTime(),
                                delta_x: 0,
                    Severity: Major
                    Found in app/assets/javascripts/foundation/foundation.orbit.js and 1 other location - About 1 hr to fix
                    app/assets/javascripts/foundation/foundation.clearing.js on lines 116..122

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

                    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

                    Method update has a Cognitive Complexity of 13 (exceeds 5 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

                    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 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 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
                        Severity
                        Category
                        Status
                        Source
                        Language