osbzr/gooderp_addons

View on GitHub
backend_theme/static/lib/js/iscroll-probe.5.2.0.js

Summary

Maintainability
F
1 wk
Test Coverage

File iscroll-probe.5.2.0.js has 1676 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*! iScroll v5.2.0 ~ (c) 2008-2016 Matteo Spinelli ~ http://cubiq.org/license */
(function (window, document, Math) {
var rAF = window.requestAnimationFrame    ||
    window.webkitRequestAnimationFrame    ||
    window.mozRequestAnimationFrame        ||
Severity: Major
Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 4 days to fix

    Function utils has 213 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var utils = (function () {
        var me = {};
    
        var _elementStyle = document.createElement('div').style;
        var _vendor = (function () {
    Severity: Major
    Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 1 day to fix

      Function _initSnap has 88 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _initSnap: function () {
              this.currentPage = {};
      
              if ( typeof this.options.snap == 'string' ) {
                  this.options.snap = this.scroller.querySelectorAll(this.options.snap);
      Severity: Major
      Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 3 hrs to fix

        Function _initIndicators has 82 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _initIndicators: function () {
                var interactive = this.options.interactiveScrollbars,
                    customStyle = typeof this.options.scrollbars != 'string',
                    indicators = [],
                    indicator;
        Severity: Major
        Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 3 hrs to fix

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

              _move: function (e) {
                  if ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {
                      return;
                  }
          
          
          Severity: Major
          Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 3 hrs to fix

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

                _wheel: function (e) {
                    if ( !this.enabled ) {
                        return;
                    }
            
            
            Severity: Major
            Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 3 hrs to fix

              Function _key has 74 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _key: function (e) {
                      if ( !this.enabled ) {
                          return;
                      }
              
              
              Severity: Major
              Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 2 hrs to fix

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

                    refresh: function () {
                        this.transitionTime();
                
                        if ( this.options.listenX && !this.options.listenY ) {
                            this.indicatorStyle.display = this.scroller.hasHorizontalScroll ? 'block' : 'none';
                Severity: Major
                Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 2 hrs to fix

                  Function _end has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      _end: function (e) {
                          if ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {
                              return;
                          }
                  
                  
                  Severity: Major
                  Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 2 hrs to fix

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

                    function IScroll (el, options) {
                        this.wrapper = typeof el == 'string' ? document.querySelector(el) : el;
                        this.scroller = this.wrapper.children[0];
                        this.scrollerStyle = this.scroller.style;        // cache style for better performance
                    
                    
                    Severity: Major
                    Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 2 hrs to fix

                      Function _nearestSnap has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          _nearestSnap: function (x, y) {
                              if ( !this.pages.length ) {
                                  return { x: 0, y: 0, pageX: 0, pageY: 0 };
                              }
                      
                      
                      Severity: Major
                      Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 2 hrs to fix

                        Function Indicator has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function Indicator (scroller, options) {
                            this.wrapper = typeof options.el == 'string' ? document.querySelector(options.el) : options.el;
                            this.wrapperStyle = this.wrapper.style;
                            this.indicator = this.wrapper.children[0];
                            this.indicatorStyle = this.indicator.style;
                        Severity: Major
                        Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 2 hrs to fix

                          Function updatePosition has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              updatePosition: function () {
                                  var x = this.options.listenX && Math.round(this.sizeRatioX * this.scroller.x) || 0,
                                      y = this.options.listenY && Math.round(this.sizeRatioY * this.scroller.y) || 0;
                          
                                  if ( !this.options.ignoreBoundaries ) {
                          Severity: Minor
                          Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 1 hr to fix

                            Function handleEvent has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                handleEvent: function (e) {
                                    switch ( e.type ) {
                                        case 'touchstart':
                                        case 'pointerdown':
                                        case 'MSPointerDown':
                            Severity: Minor
                            Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 1 hr to fix

                              Function _start has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  _start: function (e) {
                                      // React to left mouse button only
                                      if ( utils.eventType[e.type] != 1 ) {
                                        // for button property
                                        // http://unixpapa.com/js/mouse.html
                              Severity: Minor
                              Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 1 hr to fix

                                Function _animate has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    _animate: function (destX, destY, duration, easingFn) {
                                        var that = this,
                                            startX = this.x,
                                            startY = this.y,
                                            startTime = utils.getTime(),
                                Severity: Minor
                                Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 1 hr to fix

                                  Function _initEvents has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      _initEvents: function (remove) {
                                          var eventType = remove ? utils.removeEvent : utils.addEvent,
                                              target = this.options.bindToWrapper ? this.wrapper : window;
                                  
                                          eventType(window, 'orientationchange', this);
                                  Severity: Minor
                                  Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 1 hr to fix

                                    Function _initKeys has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        _initKeys: function (e) {
                                            // default key bindings
                                            var keys = {
                                                pageUp: 33,
                                                pageDown: 34,
                                    Severity: Minor
                                    Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 1 hr to fix

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

                                          _end: function (e) {
                                              if ( !this.initiated ) {
                                                  return;
                                              }
                                      
                                      
                                      Severity: Minor
                                      Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 1 hr to fix

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

                                        function createDefaultScrollbar (direction, interactive, type) {
                                            var scrollbar = document.createElement('div'),
                                                indicator = document.createElement('div');
                                        
                                            if ( type === true ) {
                                        Severity: Minor
                                        Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 1 hr to fix

                                          Function momentum has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                          Open

                                              me.momentum = function (current, start, time, lowerMargin, wrapperSize, deceleration) {
                                          Severity: Minor
                                          Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 45 mins to fix

                                            Consider simplifying this complex logical expression.
                                            Open

                                                    if ( !(/(SELECT|INPUT|TEXTAREA)/i).test(target.tagName) ) {
                                                        // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent
                                                        // initMouseEvent is deprecated.
                                                        ev = document.createEvent(window.MouseEvent ? 'MouseEvents' : 'Event');
                                                        ev.initEvent('click', true, true);
                                            Severity: Major
                                            Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 40 mins to fix

                                              Function scrollToElement has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                              Open

                                                  scrollToElement: function (el, time, offsetX, offsetY, easing) {
                                              Severity: Minor
                                              Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 35 mins to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                            return;
                                                Severity: Major
                                                Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 30 mins to fix

                                                  There are no issues that match your filters.

                                                  Category
                                                  Status