holderdeord/hdo-site

View on GitHub
app/assets/javascripts/lib/idangerous.swiper-1.8.7.js

Summary

Maintainability
F
1 wk
Test Coverage

File idangerous.swiper-1.8.7.js has 1037 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Swiper 1.8.7 - Mobile Touch Slider
 * http://www.idangero.us/sliders/swiper/
 *
 * Copyright 2012-2013, Vladimir Kharlampidi
Severity: Major
Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js - About 2 days to fix

    Function onTouchEnd has 87 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function onTouchEnd(event) {
    
        // If slider is not touched exit
        if ( params.onlyExternal || !_this.isTouched ) return
        _this.isTouched = false
    Severity: Major
    Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js - About 3 hrs to fix

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

        _this.init = function(reInit) {
          var _width = window.getComputedStyle(_this.container, null).getPropertyValue('width')
          var _height = window.getComputedStyle(_this.container, null).getPropertyValue('height')
          var newWidth = parseInt(_width,10);
          var newHeight  = parseInt(_height,10);
      Severity: Major
      Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js - About 3 hrs to fix

        Function onTouchMove has 75 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function onTouchMove(event) {
        
            // If slider is not touched - exit
            if (!_this.isTouched || params.onlyExternal) return
        
        
        Severity: Major
        Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js - About 3 hrs to fix

          Function _extendSwiperSlide has 62 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            _this._extendSwiperSlide = function  (el) {
                el.append = function () {
                  _this.wrapper.appendChild(el);
                  _this.reInit();
                  return el;
          Severity: Major
          Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js - About 2 hrs to fix

            Function onTouchStart has 58 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function onTouchStart(event) {
            
                //Exit if slider is already was touched
                if (_this.isTouched || params.onlyExternal) {
                  return false
            Severity: Major
            Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js - About 2 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                    if (params.onSlideClick || params.onSlideTouch) {
                      ;(function () {
                        var el = _this.container;
                        var box = el.getBoundingClientRect();
                        var body = document.body;
              Severity: Critical
              Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js - About 1 hr to fix

                Function swipeReset has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  _this.swipeReset = function(prevention) {
                    _this.callPlugins('onSwipeReset');
                
                    var getTranslate = isHorizontal ? _this.getTranslate('x') : _this.getTranslate('y');
                    var newPosition = getTranslate<0 ? Math.round(getTranslate/slideSize)*slideSize : 0
                Severity: Minor
                Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js - About 1 hr to fix

                  Function getTranslate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                    getTranslate : function(axis){
                      var el = this.wrapper
                      var matrix;
                      var curTransform;
                      if (window.WebKitCSSMatrix) {
                  Severity: Minor
                  Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js - About 55 mins 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

                  Avoid deeply nested control flow statements.
                  Open

                              if (_this.positions.current>0) _this.positions.current = 0;
                  Severity: Major
                  Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js - About 45 mins to fix

                    Consider simplifying this complex logical expression.
                    Open

                        if (window.WebKitCSSMatrix) {
                          var transformMatrix = new WebKitCSSMatrix(window.getComputedStyle(el, null).webkitTransform)
                          matrix = transformMatrix.toString().split(',');
                        }
                        else {
                    Severity: Major
                    Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js - About 40 mins to fix

                      Function isSupport3D has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                        isSupport3D : function() {
                          var div = document.createElement('div');
                          div.id = 'test3d';
                      
                          var s3d=false;
                      Severity: Minor
                      Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js - About 35 mins 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

                      Avoid too many return statements within this function.
                      Open

                            return false
                      Severity: Major
                      Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js - About 30 mins to fix

                        Function transitionEnd has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                          transitionEnd : function(callback) {
                            var a = this
                            var el = a.wrapper
                            var events = ['webkitTransitionEnd','transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'];
                            if (callback) {
                        Severity: Minor
                        Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js - About 25 mins 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

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

                            if(isNaN(newHeight) || _this.ie8 && (_height.indexOf('%')>0) ) {
                              newHeight = _this.container.offsetHeight - parseInt(window.getComputedStyle(_this.container, null).getPropertyValue('padding-top'),10) - parseInt(window.getComputedStyle(_this.container, null).getPropertyValue('padding-bottom'),10)
                            }
                        Severity: Major
                        Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js and 1 other location - About 2 hrs to fix
                        app/assets/javascripts/lib/idangerous.swiper-1.8.7.js on lines 394..396

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

                        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(isNaN(newWidth) || _this.ie8 && (_width.indexOf('%')>0)  ) {
                              newWidth = _this.container.offsetWidth - parseInt(window.getComputedStyle(_this.container, null).getPropertyValue('padding-left'),10) - parseInt(window.getComputedStyle(_this.container, null).getPropertyValue('padding-right'),10)
                            }
                        Severity: Major
                        Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js and 1 other location - About 2 hrs to fix
                        app/assets/javascripts/lib/idangerous.swiper-1.8.7.js on lines 397..399

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

                        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.prependSlide = function (html, slideClassList, el) {
                            if (!html) return;
                            if (html.nodeType) {
                              return _this._extendSwiperSlide(html).prepend()
                            }
                        Severity: Major
                        Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js and 1 other location - About 2 hrs to fix
                        app/assets/javascripts/lib/idangerous.swiper-1.8.7.js on lines 267..275

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

                        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.appendSlide = function (html, slideClassList, el) {
                            if (!html) return;
                            if (html.nodeType) {
                              return _this._extendSwiperSlide(html).append()
                            }
                        Severity: Major
                        Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js and 1 other location - About 2 hrs to fix
                        app/assets/javascripts/lib/idangerous.swiper-1.8.7.js on lines 276..284

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

                        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 (isHorizontal) {
                                if (kc==37 || kc==39) e.preventDefault();
                                if (kc == 39) _this.swipeNext()
                                if (kc == 37) _this.swipePrev()
                              }
                        Severity: Major
                        Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js and 1 other location - About 1 hr to fix
                        app/assets/javascripts/lib/idangerous.swiper-1.8.7.js on lines 677..681

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

                        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 (kc==38 || kc==40) e.preventDefault();
                                if (kc == 40) _this.swipeNext()
                                if (kc == 38) _this.swipePrev()
                              }
                        Severity: Major
                        Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js and 1 other location - About 1 hr to fix
                        app/assets/javascripts/lib/idangerous.swiper-1.8.7.js on lines 672..676

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

                        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 isScrolling == 'undefined' && !isHorizontal) {
                              isScrolling = !!( isScrolling || Math.abs(pageY - _this.touches.startY) < Math.abs( pageX - _this.touches.startX ) )
                            }
                        Severity: Major
                        Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js and 1 other location - About 1 hr to fix
                        app/assets/javascripts/lib/idangerous.swiper-1.8.7.js on lines 819..821

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

                        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 isScrolling == 'undefined' && isHorizontal) {
                              isScrolling = !!( isScrolling || Math.abs(pageY - _this.touches.startY) > Math.abs( pageX - _this.touches.startX ) )
                            }
                        Severity: Major
                        Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js and 1 other location - About 1 hr to fix
                        app/assets/javascripts/lib/idangerous.swiper-1.8.7.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 63.

                        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 (axis=='x') {
                              //Crazy IE10 Matrix
                              if (matrix.length==16)
                                curTransform = parseInt( matrix[12], 10 )
                              //Normal Browsers
                        Severity: Major
                        Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js and 1 other location - About 1 hr to fix
                        app/assets/javascripts/lib/idangerous.swiper-1.8.7.js on lines 1321..1328

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

                        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 (axis=='y') {
                              //Crazy IE10 Matrix
                              if (matrix.length==16)
                                curTransform = parseInt( matrix[13], 10 )
                              //Normal Browsers
                        Severity: Major
                        Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js and 1 other location - About 1 hr to fix
                        app/assets/javascripts/lib/idangerous.swiper-1.8.7.js on lines 1311..1319

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

                        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

                            Element.prototype.addEventListener = HTMLDocument.prototype.addEventListener = addEventListener = function (type, listener, useCapture) { this.attachEvent('on' + type, listener); }
                        Severity: Major
                        Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js and 1 other location - About 1 hr to fix
                        app/assets/javascripts/lib/idangerous.swiper-1.8.7.js on lines 23..23

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

                        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

                            Element.prototype.removeEventListener = HTMLDocument.prototype.removeEventListener = removeEventListener = function (type, listener, useCapture) { this.detachEvent('on' + type, listener); }
                        Severity: Major
                        Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js and 1 other location - About 1 hr to fix
                        app/assets/javascripts/lib/idangerous.swiper-1.8.7.js on lines 22..22

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

                        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 pageY = _this.support.touch ? event.targetTouches[0].pageY : (event.pageY || event.clientY)
                        Severity: Minor
                        Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js and 1 other location - About 35 mins to fix
                        app/assets/javascripts/lib/idangerous.swiper-1.8.7.js on lines 816..816

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

                        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 pageY = _this.support.touch ? event.targetTouches[0].pageY : (event.pageY || event.clientY)
                        Severity: Minor
                        Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js and 1 other location - About 35 mins to fix
                        app/assets/javascripts/lib/idangerous.swiper-1.8.7.js on lines 745..745

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

                        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 (_this.positions.current < -maxPosition) {
                              _this.swipeReset()
                              if (params.onTouchEnd) params.onTouchEnd(_this)
                              _this.callPlugins('onTouchEnd');
                              return
                        Severity: Minor
                        Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js and 1 other location - About 30 mins to fix
                        app/assets/javascripts/lib/idangerous.swiper-1.8.7.js on lines 972..977

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

                        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 (_this.positions.current > 0) {
                              _this.swipeReset()
                              if (params.onTouchEnd) params.onTouchEnd(_this)
                              _this.callPlugins('onTouchEnd');
                              return
                        Severity: Minor
                        Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js and 1 other location - About 30 mins to fix
                        app/assets/javascripts/lib/idangerous.swiper-1.8.7.js on lines 979..984

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

                        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 pageX = _this.support.touch ? event.targetTouches[0].pageX : (event.pageX || event.clientX)
                        Severity: Minor
                        Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js and 1 other location - About 30 mins to fix
                        app/assets/javascripts/lib/idangerous.swiper-1.8.7.js on lines 744..744

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

                        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 pageX = _this.support.touch ? event.targetTouches[0].pageX : (event.pageX || event.clientX)
                        Severity: Minor
                        Found in app/assets/javascripts/lib/idangerous.swiper-1.8.7.js and 1 other location - About 30 mins to fix
                        app/assets/javascripts/lib/idangerous.swiper-1.8.7.js on lines 815..815

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

                        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