drhenner/ror_ecommerce

View on GitHub

Showing 346 of 346 total issues

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

              if ($associatedElement.attr('type') === 'checkbox') {
                e.preventDefault();
                $customCheckbox = $(this).find('span.custom.checkbox');
                //the checkbox might be outside after the label or inside of another element
                if ($customCheckbox.length === 0) {
Severity: Major
Found in app/assets/javascripts/foundation/foundation.forms.js and 1 other location - About 2 hrs to fix
app/assets/javascripts/foundation/foundation.forms.js on lines 89..97

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

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 bbq.js has 287 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010
 * http://benalman.com/projects/jquery-bbq-plugin/
 * 
 * Copyright (c) 2010 "Cowboy" Ben Alman
Severity: Minor
Found in app/assets/javascripts/jqwizard/bbq.js - About 2 hrs to fix

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

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

      Class ApplicationController has 25 methods (exceeds 20 allowed). Consider refactoring.
      Open

      class ApplicationController < ActionController::Base
        protect_from_forgery
        layout 'application'
      
        helper_method :current_user,
      Severity: Minor
      Found in app/controllers/application_controller.rb - About 2 hrs to fix

        Class Address has 25 methods (exceeds 20 allowed). Consider refactoring.
        Open

        class Address < ApplicationRecord
        
          belongs_to  :state
          belongs_to  :country
          belongs_to  :address_type
        Severity: Minor
        Found in app/models/address.rb - About 2 hrs to fix

          Function datePicker has 70 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  datePicker : function(s)
                  {            
                      if (!$.event._dpCache) $.event._dpCache = [];
                      
                      // initialise the date picker controller with the relevant settings...
          Severity: Major
          Found in app/assets/javascripts/jquery.datePicker-2.1.2.js - About 2 hrs to fix

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

                events : function () {
                  var self = this;
                  $(this.scope).on('arrival.fndtn.magellan', '[data-magellan-arrival]', function (e) {
                    var $destination = $(this),
                        $expedition = $destination.closest('[data-magellan-expedition]'),
            Severity: Major
            Found in app/assets/javascripts/foundation/foundation.magellan.js - About 2 hrs to fix

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

                  show : function (init) {
                    var $timer = null;
              
                    // are we paused?
                    if (this.settings.$li === undefined
              Severity: Major
              Found in app/assets/javascripts/foundation/foundation.joyride.js - About 2 hrs to fix

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

                  function toggleCheckbox($element) {
                    var $input = $element.prev(),
                        input = $input[0];
                
                    if (false == $input.is(':disabled')) {
                Severity: Major
                Found in app/assets/javascripts/admin/jquery.customforms.js and 1 other location - About 2 hrs to fix
                app/assets/javascripts/foundation/foundation.forms.js on lines 433..443

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

                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

                      this.$wrapper.find('.right').click(function () {
                        self.stopClock();
                        if (self.options.resetTimerOnClick) {
                          self.rotateTimer(true);
                          self.startClock();
                Severity: Major
                Found in app/assets/javascripts/admin/jquery.orbit-1.4.0.js and 1 other location - About 2 hrs to fix
                app/assets/javascripts/admin/jquery.orbit-1.4.0.js on lines 372..379

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

                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

                      this.$wrapper.find('.left').click(function () {
                        self.stopClock();
                        if (self.options.resetTimerOnClick) {
                          self.rotateTimer(true);
                          self.startClock();
                Severity: Major
                Found in app/assets/javascripts/admin/jquery.orbit-1.4.0.js and 1 other location - About 2 hrs to fix
                app/assets/javascripts/admin/jquery.orbit-1.4.0.js on lines 381..388

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

                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

                    toggle_checkbox: function ($element) {
                      var $input = $element.prev(),
                          input = $input[0];
                
                      if (false === $input.is(':disabled')) {
                Severity: Major
                Found in app/assets/javascripts/foundation/foundation.forms.js and 1 other location - About 2 hrs to fix
                app/assets/javascripts/admin/jquery.customforms.js on lines 142..152

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

                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 Invoice has 24 methods (exceeds 20 allowed). Consider refactoring.
                Open

                class Invoice < ApplicationRecord
                  include AASM
                
                  has_many :payments
                  has_many :batches, as: :batchable#, :polymorphic => true
                Severity: Minor
                Found in app/models/invoice.rb - About 2 hrs to fix

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

                  /* 
                   * The MIT License
                   *
                   * Copyright (c) 2012 James Allardice
                   *
                  Severity: Minor
                  Found in app/assets/javascripts/foundation/foundation.placeholder.js - About 2 hrs to fix

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

                        $customSelect.find('li').each(function () {
                          $customSelect.addClass('open');
                          if ($(this).outerWidth() > maxWidth) {
                            maxWidth = $(this).outerWidth();
                          }
                    Severity: Major
                    Found in app/assets/javascripts/admin/jquery.customforms.js and 1 other location - About 2 hrs to fix
                    app/assets/javascripts/admin/jquery.customforms.js on lines 130..136

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

                    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

                        $customSelect.find('li').each(function () {
                          $customSelect.addClass('open');
                          if ($(this).outerWidth() > maxWidth) {
                            maxWidth = $(this).outerWidth();
                          }
                    Severity: Major
                    Found in app/assets/javascripts/admin/jquery.customforms.js and 1 other location - About 2 hrs to fix
                    app/assets/javascripts/admin/jquery.customforms.js on lines 79..85

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

                    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

                            } else if (classes && classes.indexOf('tip-left') > -1) {
                              objPos(tip, (target.offset().top + (this.outerHeight(target) / 2) - nubHeight*2.5), 'auto', 'auto', (target.offset().left - this.outerWidth(tip) - nubHeight), width)
                                .removeClass('tip-override');
                            } else if (classes && classes.indexOf('tip-right') > -1) {
                              objPos(tip, (target.offset().top + (this.outerHeight(target) / 2) - nubHeight*2.5), 'auto', 'auto', (target.offset().left + this.outerWidth(target) + nubHeight), width)
                    Severity: Major
                    Found in app/assets/javascripts/foundation/foundation.tooltips.js and 1 other location - About 2 hrs to fix
                    app/assets/javascripts/foundation/foundation.tooltips.js on lines 159..162

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

                    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

                            } else if (classes && classes.indexOf('tip-right') > -1) {
                              objPos(tip, (target.offset().top + (this.outerHeight(target) / 2) - nubHeight*2.5), 'auto', 'auto', (target.offset().left + this.outerWidth(target) + nubHeight), width)
                                .removeClass('tip-override');
                            }
                    Severity: Major
                    Found in app/assets/javascripts/foundation/foundation.tooltips.js and 1 other location - About 2 hrs to fix
                    app/assets/javascripts/foundation/foundation.tooltips.js on lines 156..162

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

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

                        append_custom_select: function (idx, sel) {
                            var self = Foundation.libs.forms,
                                $this = $(sel),
                                $customSelect = $this.next('div.custom.dropdown'),
                                $customList = $customSelect.find('ul'),
                    Severity: Major
                    Found in app/assets/javascripts/foundation/foundation.forms.js - About 2 hrs to fix

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

                          $options.each(function (index) {
                            if (this.selected) {
                              $customSelect.find('li').eq(index).addClass('selected');
                              $customSelect.find('.current').html($(this).html());
                            }
                      Severity: Major
                      Found in app/assets/javascripts/admin/jquery.customforms.js and 1 other location - About 2 hrs to fix
                      app/assets/javascripts/admin/jquery.customforms.js on lines 120..125

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

                      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