drhenner/ror_ecommerce

View on GitHub

Showing 346 of 346 total issues

Function Zepto has a Cognitive Complexity of 301 (exceeds 5 allowed). Consider refactoring.
Open

var Zepto = (function() {
  var undefined, key, $, classList, emptyArray = [], slice = emptyArray.slice, filter = emptyArray.filter,
    document = window.document,
    elementDisplay = {}, classCache = {},
    getComputedStyle = document.defaultView.getComputedStyle,
Severity: Minor
Found in app/assets/javascripts/zepto.js - About 6 days 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

File zepto.js has 1530 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* Zepto v1.0-1-ga3cab6c - polyfill zepto detect event ajax form fx - zeptojs.com/license */


;(function(undefined){
  if (String.prototype.trim === undefined) // fix for iOS 3.2
Severity: Major
Found in app/assets/javascripts/zepto.js - About 4 days to fix

    Function Zepto has 647 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var Zepto = (function() {
      var undefined, key, $, classList, emptyArray = [], slice = emptyArray.slice, filter = emptyArray.filter,
        document = window.document,
        elementDisplay = {}, classCache = {},
        getComputedStyle = document.defaultView.getComputedStyle,
    Severity: Major
    Found in app/assets/javascripts/zepto.js - About 3 days to fix

      Function markItUp has 466 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        $.fn.markItUp = function(settings, extraSettings) {
          var options, ctrlKey, shiftKey, altKey;
          ctrlKey = shiftKey = altKey = false;
      
          options = { id:           '',
      Severity: Major
      Found in app/assets/javascripts/markitup/jquery.markitup.js - About 2 days to fix

        File jquery.validate.js has 905 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*
         * jQuery validation plug-in 1.7
         *
         * http://bassistance.de/jquery-plugins/jquery-plugin-validation/
         * http://docs.jquery.com/Plugins/Validation
        Severity: Major
        Found in app/assets/javascripts/jqwizard/jquery.validate.js - About 2 days to fix

          File chosen.jquery.js has 881 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          // Chosen, a Select Box Enhancer for jQuery and Protoype
          // by Patrick Filler for Harvest, http://getharvest.com
          //
          // Version 0.9.5
          // Full source at https://github.com/harvesthq/chosen
          Severity: Major
          Found in app/assets/javascripts/chosen/chosen.jquery.js - About 2 days to fix

            File jquery.datePicker-2.1.2.js has 739 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /**
             * Copyright (c) 2008 Kelvin Luck (http://www.kelvinluck.com/)
             * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
             * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
             *
            Severity: Major
            Found in app/assets/javascripts/jquery.datePicker-2.1.2.js - About 1 day to fix

              File foundation.joyride.js has 657 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*jslint unparam: true, browser: true, indent: 2 */
              
              (function ($, window, document, undefined) {
                'use strict';
              
              
              Severity: Major
              Found in app/assets/javascripts/foundation/foundation.joyride.js - About 1 day to fix

                Function ajaxSubmit has 244 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                $.fn.ajaxSubmit = function(options) {
                    // fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
                    if (!this.length) {
                        log('ajaxSubmit: skipping submit process - no element selected');
                        return this;
                Severity: Major
                Found in app/assets/javascripts/jqwizard/jquery.form.js - About 1 day to fix

                  Function Orbit has 228 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    var Orbit = function(el, settings) {
                      // Don't reinitialize plugin
                      if (el.hasClass(settings.slides_container_class)) {
                        return this;
                      }
                  Severity: Major
                  Found in app/assets/javascripts/foundation/foundation.orbit.js - About 1 day to fix

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

                                    if (this.displayedYear == this.startDate.getFullYear() && this.displayedMonth == this.startDate.getMonth()) {
                                        $('.dp-nav-prev-year', this.context).addClass('disabled');
                                        $('.dp-nav-prev-month', this.context).addClass('disabled');
                                        $('.dp-calendar td.other-month', this.context).each(
                                            function()
                    Severity: Major
                    Found in app/assets/javascripts/jquery.datePicker-2.1.2.js and 1 other location - About 1 day to fix
                    app/assets/javascripts/jquery.datePicker-2.1.2.js on lines 946..988

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

                    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.displayedYear == this.endDate.getFullYear() && this.displayedMonth == this.endDate.getMonth()) {
                                        $('.dp-nav-next-year', this.context).addClass('disabled');
                                        $('.dp-nav-next-month', this.context).addClass('disabled');
                                        $('.dp-calendar td.other-month', this.context).each(
                                            function()
                    Severity: Major
                    Found in app/assets/javascripts/jquery.datePicker-2.1.2.js and 1 other location - About 1 day to fix
                    app/assets/javascripts/jquery.datePicker-2.1.2.js on lines 903..945

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

                    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

                    File jquery.orbit-1.4.0.js has 508 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /*
                     * jQuery Orbit Plugin 1.4.0
                     * www.ZURB.com/playground
                     * Copyright 2010, ZURB
                     * Free to use under the MIT license.
                    Severity: Major
                    Found in app/assets/javascripts/admin/jquery.orbit-1.4.0.js - About 1 day to fix

                      File jquery.markitup.js has 489 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      // ----------------------------------------------------------------------------
                      // markItUp! Universal MarkUp Engine, JQuery plugin
                      // v 1.1.x
                      // Dual licensed under the MIT and GPL licenses.
                      // ----------------------------------------------------------------------------
                      Severity: Minor
                      Found in app/assets/javascripts/markitup/jquery.markitup.js - About 7 hrs to fix

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

                                if (this.options.animation == "horizontal-slide") {
                                  if (slideDirection == "next") {
                                    this.$slides
                                      .eq(this.activeSlide)
                                      .css({"left": this.orbitWidth, "z-index" : 3})
                        Severity: Major
                        Found in app/assets/javascripts/admin/jquery.orbit-1.4.0.js and 1 other location - About 7 hrs to fix
                        app/assets/javascripts/admin/jquery.orbit-1.4.0.js on lines 507..520

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

                        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.options.animation == "vertical-slide") {
                                  if (slideDirection == "prev") {
                                    this.$slides
                                      .eq(this.activeSlide)
                                      .css({"top": this.orbitHeight, "z-index" : 3})
                        Severity: Major
                        Found in app/assets/javascripts/admin/jquery.orbit-1.4.0.js and 1 other location - About 7 hrs to fix
                        app/assets/javascripts/admin/jquery.orbit-1.4.0.js on lines 491..504

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

                        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

                        Class Order has 51 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        class Order < ApplicationRecord
                          include AASM
                          extend FriendlyId
                          friendly_id :number
                          include Presentation::OrderPresenter
                        Severity: Major
                        Found in app/models/order.rb - About 7 hrs to fix

                          Function selectList has 173 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          $.selectList = function(select, options) {
                              var
                          
                                  $list,
                          
                          
                          Severity: Major
                          Found in app/assets/javascripts/jquery.selectlist.js - About 6 hrs to fix

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

                                    if (!self.rtl) {
                                      section.css({left: -(100 * topbar.data('index')) + '%'});
                                      section.find('>.name').css({left: 100 * topbar.data('index') + '%'});
                                    } else {
                                      section.css({right: -(100 * topbar.data('index')) + '%'});
                            Severity: Major
                            Found in app/assets/javascripts/foundation/foundation.topbar.js and 1 other location - About 6 hrs to fix
                            app/assets/javascripts/foundation/foundation.topbar.js on lines 196..202

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

                            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 (!self.rtl) {
                                          section.css({left: -(100 * topbar.data('index')) + '%'});
                                          section.find('>.name').css({left: 100 * topbar.data('index') + '%'});
                                        } else {
                                          section.css({right: -(100 * topbar.data('index')) + '%'});
                            Severity: Major
                            Found in app/assets/javascripts/foundation/foundation.topbar.js and 1 other location - About 6 hrs to fix
                            app/assets/javascripts/foundation/foundation.topbar.js on lines 267..273

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

                            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