drhenner/ror_ecommerce

View on GitHub
app/assets/javascripts/foundation/foundation.clearing.js

Summary

Maintainability
D
2 days
Test Coverage

File foundation.clearing.js has 394 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.clearing.js - About 5 hrs 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

      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

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

              function bindLoad () {
                this.one('load', loaded);
        
                if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
                  var src = this.attr( 'src' ),
        Severity: Major
        Found in app/assets/javascripts/foundation/foundation.clearing.js and 1 other location - About 3 hrs to fix
        app/assets/javascripts/foundation/foundation.interchange.js on lines 162..172

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

        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 ( typeof data.is_scrolling === 'undefined') {
                    data.is_scrolling = !!( data.is_scrolling || Math.abs(data.delta_x) < Math.abs(e.touches[0].pageY - data.start_page_y) );
                  }
        Severity: Major
        Found in app/assets/javascripts/foundation/foundation.clearing.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/foundation/foundation.orbit.js on lines 237..239

        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

        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

              if (target.next().length > 0) {
                visible_image
                  .find('.clearing-main-next')
                  .removeClass('disabled');
              } else {
        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.clearing.js on lines 291..299

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

        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 (target.prev().length > 0) {
                visible_image
                  .find('.clearing-main-prev')
                  .removeClass('disabled');
              } else {
        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.clearing.js on lines 281..289

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

        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 {
                target.css({
                  marginRight : -(this.outerWidth(target) / 2),
                  marginTop : -(this.outerHeight(target) / 2)
                });
        Severity: Minor
        Found in app/assets/javascripts/foundation/foundation.clearing.js and 1 other location - About 55 mins to fix
        app/assets/javascripts/foundation/foundation.clearing.js on lines 303..308

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

        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.rtl) {
                target.css({
                  marginLeft : -(this.outerWidth(target) / 2),
                  marginTop : -(this.outerHeight(target) / 2)
                });
        Severity: Minor
        Found in app/assets/javascripts/foundation/foundation.clearing.js and 1 other location - About 55 mins to fix
        app/assets/javascripts/foundation/foundation.clearing.js on lines 308..313

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

        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 (image[0].complete || image[0].readyState === 4) {
                loaded();
              } else {
                bindLoad.call(image);
              }
        Severity: Minor
        Found in app/assets/javascripts/foundation/foundation.clearing.js and 1 other location - About 50 mins to fix
        app/assets/javascripts/foundation/foundation.interchange.js on lines 179..183

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

        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

        There are no issues that match your filters.

        Category
        Status