devworkstecnology/webadmin

View on GitHub

Showing 59 of 202 total issues

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

    var generateSparkline = function($re){
        $(".sparkline").each(function(){
            var $data = $(this).data();
            if($re && !$data.resize) return;
            if($data.type == 'bar'){
Severity: Minor
Found in vendor/assets/javascripts/app.plugin.js - About 1 hr to fix

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

        $.fn.dropdown.Constructor.prototype.change = function(e){
          e.preventDefault();
          var $item = $(e.target), $select, $checked = false, $menu, $label;
          !$item.is('a') && ($item = $item.closest('a'));
          $menu = $item.closest('.dropdown-menu');
    Severity: Minor
    Found in vendor/assets/javascripts/app.js - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

      (function(a,b,c){typeof define=="function"&&define.amd?define(["jquery"],function(d){return c(d,a,b),d.mobile}):c(a.jQuery,a,b)})(this,document,function(a,b,c,d){(function(a){a.mobile={}})(a),function(a,b){var d={touch:"ontouchend"in c};a.mobile.support=a.mobile.support||{},a.extend(a.support,d),a.extend(a.mobile.support,d)}(a),function(a,b,c,d){function x(a){while(a&&typeof a.originalEvent!="undefined")a=a.originalEvent;return a}function y(b,c){var e=b.type,f,g,i,k,l,m,n,o,p;b=a.Event(b),b.type=c,f=b.originalEvent,g=a.event.props,e.search(/^(mouse|click)/)>-1&&(g=j);if(f)for(n=g.length,k;n;)k=g[--n],b[k]=f[k];e.search(/mouse(down|up)|click/)>-1&&!b.which&&(b.which=1);if(e.search(/^touch/)!==-1){i=x(f),e=i.touches,l=i.changedTouches,m=e&&e.length?e[0]:l&&l.length?l[0]:d;if(m)for(o=0,p=h.length;o<p;o++)k=h[o],b[k]=m[k]}return b}function z(b){var c={},d,f;while(b){d=a.data(b,e);for(f in d)d[f]&&(c[f]=c.hasVirtualBinding=!0);b=b.parentNode}return c}function A(b,c){var d;while(b){d=a.data(b,e);if(d&&(!c||d[c]))return b;b=b.parentNode}return null}function B(){r=!1}function C(){r=!0}function D(){v=0,p.length=0,q=!1,C()}function E(){B()}function F(){G(),l=setTimeout(function(){l=0,D()},a.vmouse.resetTimerDuration)}function G(){l&&(clearTimeout(l),l=0)}function H(b,c,d){var e;if(d&&d[b]||!d&&A(c.target,b))e=y(c,b),a(c.target).trigger(e);return e}function I(b){var c=a.data(b.target,f);if(!q&&(!v||v!==c)){var d=H("v"+b.type,b);d&&(d.isDefaultPrevented()&&b.preventDefault(),d.isPropagationStopped()&&b.stopPropagation(),d.isImmediatePropagationStopped()&&b.stopImmediatePropagation())}}function J(b){var c=x(b).touches,d,e;if(c&&c.length===1){d=b.target,e=z(d);if(e.hasVirtualBinding){v=u++,a.data(d,f,v),G(),E(),o=!1;var g=x(b).touches[0];m=g.pageX,n=g.pageY,H("vmouseover",b,e),H("vmousedown",b,e)}}}function K(a){if(r)return;o||H("vmousecancel",a,z(a.target)),o=!0,F()}function L(b){if(r)return;var c=x(b).touches[0],d=o,e=a.vmouse.moveDistanceThreshold,f=z(b.target);o=o||Math.abs(c.pageX-m)>e||Math.abs(c.pageY-n)>e,o&&!d&&H("vmousecancel",b,f),H("vmousemove",b,f),F()}function M(a){if(r)return;C();var b=z(a.target),c;H("vmouseup",a,b);if(!o){var d=H("vclick",a,b);d&&d.isDefaultPrevented()&&(c=x(a).changedTouches[0],p.push({touchID:v,x:c.clientX,y:c.clientY}),q=!0)}H("vmouseout",a,b),o=!1,F()}function N(b){var c=a.data(b,e),d;if(c)for(d in c)if(c[d])return!0;return!1}function O(){}function P(b){var c=b.substr(1);return{setup:function(d,f){N(this)||a.data(this,e,{});var g=a.data(this,e);g[b]=!0,k[b]=(k[b]||0)+1,k[b]===1&&t.bind(c,I),a(this).bind(c,O),s&&(k.touchstart=(k.touchstart||0)+1,k.touchstart===1&&t.bind("touchstart",J).bind("touchend",M).bind("touchmove",L).bind("scroll",K))},teardown:function(d,f){--k[b],k[b]||t.unbind(c,I),s&&(--k.touchstart,k.touchstart||t.unbind("touchstart",J).unbind("touchmove",L).unbind("touchend",M).unbind("scroll",K));var g=a(this),h=a.data(this,e);h&&(h[b]=!1),g.unbind(c,O),N(this)||g.removeData(e)}}}var e="virtualMouseBindings",f="virtualTouchID",g="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),h="clientX clientY pageX pageY screenX screenY".split(" "),i=a.event.mouseHooks?a.event.mouseHooks.props:[],j=a.event.props.concat(i),k={},l=0,m=0,n=0,o=!1,p=[],q=!1,r=!1,s="addEventListener"in c,t=a(c),u=1,v=0,w;a.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500};for(var Q=0;Q<g.length;Q++)a.event.special[g[Q]]=P(g[Q]);s&&c.addEventListener("click",function(b){var c=p.length,d=b.target,e,g,h,i,j,k;if(c){e=b.clientX,g=b.clientY,w=a.vmouse.clickDistanceThreshold,h=d;while(h){for(i=0;i<c;i++){j=p[i],k=0;if(h===d&&Math.abs(j.x-e)<w&&Math.abs(j.y-g)<w||a.data(h,f)===j.touchID){b.preventDefault(),b.stopPropagation();return}}h=h.parentNode}}},!0)}(a,b,c),function(a,b,d){function k(b,c,d){var e=d.type;d.type=c,a.event.dispatch.call(b,d),d.type=e}var e=a(c);a.each("touchstart touchmove touchend tap taphold swipe swipeleft swiperight scrollstart scrollstop".split(" "),function(b,c){a.fn[c]=function(a){return a?this.bind(c,a):this.trigger(c)},a.attrFn&&(a.attrFn[c]=!0)});var f=a.mobile.support.touch,g="touchmove scroll",h=f?"touchstart":"mousedown",i=f?"touchend":"mouseup",j=f?"touchmove":"mousemove";a.event.special.scrollstart={enabled:!0,setup:function(){function f(a,c){d=c,k(b,d?"scrollstart":"scrollstop",a)}var b=this,c=a(b),d,e;c.bind(g,function(b){if(!a.event.special.scrollstart.enabled)return;d||f(b,!0),clearTimeout(e),e=setTimeout(function(){f(b,!1)},50)})}},a.event.special.tap={tapholdThreshold:750,setup:function(){var b=this,c=a(b);c.bind("vmousedown",function(d){function i(){clearTimeout(h)}function j(){i(),c.unbind("vclick",l).unbind("vmouseup",i),e.unbind("vmousecancel",j)}function l(a){j(),f===a.target&&k(b,"tap",a)}if(d.which&&d.which!==1)return!1;var f=d.target,g=d.originalEvent,h;c.bind("vmouseup",i).bind("vclick",l),e.bind("vmousecancel",j),h=setTimeout(function(){k(b,"taphold",a.Event("taphold",{target:f}))},a.event.special.tap.tapholdThreshold)})}},a.event.special.swipe={scrollSupressionThreshold:30,durationThreshold:1e3,horizontalDistanceThreshold:30,verticalDistanceThreshold:75,start:function(b){var c=b.originalEvent.touches?b.originalEvent.touches[0]:b;return{time:(new Date).getTime(),coords:[c.pageX,c.pageY],origin:a(b.target)}},stop:function(a){var b=a.originalEvent.touches?a.originalEvent.touches[0]:a;return{time:(new Date).getTime(),coords:[b.pageX,b.pageY]}},handleSwipe:function(b,c){c.time-b.time<a.event.special.swipe.durationThreshold&&Math.abs(b.coords[0]-c.coords[0])>a.event.special.swipe.horizontalDistanceThreshold&&Math.abs(b.coords[1]-c.coords[1])<a.event.special.swipe.verticalDistanceThreshold&&b.origin.trigger("swipe").trigger(b.coords[0]>c.coords[0]?"swipeleft":"swiperight")},setup:function(){var b=this,c=a(b);c.bind(h,function(b){function g(b){if(!e)return;f=a.event.special.swipe.stop(b),Math.abs(e.coords[0]-f.coords[0])>a.event.special.swipe.scrollSupressionThreshold&&b.preventDefault()}var e=a.event.special.swipe.start(b),f;c.bind(j,g).one(i,function(){c.unbind(j,g),e&&f&&a.event.special.swipe.handleSwipe(e,f),e=f=d})})}},a.each({scrollstop:"scrollstart",taphold:"tap",swipeleft:"swipe",swiperight:"swipe"},function(b,c){a.event.special[b]={setup:function(){a(this).bind(c,a.noop)}}})}(a,this)})
      Severity: Major
      Found in vendor/assets/javascripts/app.js - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

                            } else if (e.type === 'mousedown' || e.type === 'mouseup' || e.type === 'mousemove' || e.type === 'mouseover' || e.type === 'mouseout' || e.type === 'mouseenter' || e.type === 'mouseleave') {
                                out.x = e.clientX;
                                out.y = e.clientY;
                            }
        Severity: Major
        Found in vendor/assets/javascripts/jquery.datetimepicker.js - About 1 hr to fix

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

            contextPrototype.arc = function(aX, aY, aRadius,
                                            aStartAngle, aEndAngle, aClockwise) {
          Severity: Minor
          Found in vendor/assets/javascripts/ie/excanvas.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                    if (angle < 0) {
                      angle += 360;
                    }
            Severity: Major
            Found in vendor/assets/javascripts/ie/excanvas.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                      if (angle < 1e-6) {
                        angle = 0;
                      }
              Severity: Major
              Found in vendor/assets/javascripts/ie/excanvas.js - About 45 mins to fix

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

                  contextPrototype.bezierCurveTo = function(aCP1x, aCP1y,
                                                            aCP2x, aCP2y,
                                                            aX, aY) {
                Severity: Minor
                Found in vendor/assets/javascripts/ie/excanvas.js - About 45 mins to fix

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

                    contextPrototype.createRadialGradient = function(aX0, aY0, aR0,
                                                                     aX1, aY1, aR1) {
                  Severity: Minor
                  Found in vendor/assets/javascripts/ie/excanvas.js - About 45 mins to fix

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

                      contextPrototype.setTransform = function(m11, m12, m21, m22, dx, dy) {
                    Severity: Minor
                    Found in vendor/assets/javascripts/ie/excanvas.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                          if (pos === options.mask.length) {
                                                              event.preventDefault();
                                                              return false;
                                                          }
                      Severity: Major
                      Found in vendor/assets/javascripts/jquery.datetimepicker.js - About 45 mins to fix

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

                          contextPrototype.transform = function(m11, m12, m21, m22, dx, dy) {
                        Severity: Minor
                        Found in vendor/assets/javascripts/ie/excanvas.js - About 45 mins to fix

                          Consider simplifying this complex logical expression.
                          Open

                                                      if ((maxDate !== false && start > maxDate) || (minDate !== false && start < minDate) || (customDateSettings && customDateSettings[0] === false)) {
                                                          classes.push('xdsoft_disabled');
                                                      } else if (options.disabledDates.indexOf(start.dateFormat(options.formatDate)) !== -1) {
                                                          classes.push('xdsoft_disabled');
                                                      } else if (options.disabledWeekDays.indexOf(day) !== -1) {
                          Severity: Major
                          Found in vendor/assets/javascripts/jquery.datetimepicker.js - About 40 mins to fix

                            Consider simplifying this complex logical expression.
                            Open

                                                            if (!options.datepicker && options.timepicker && splittedHours >= 0 && splittedHours < 24 && splittedMinutes >= 0 && splittedMinutes < 60) {
                                                                $(this).val([splittedHours, splittedMinutes].map(function (item) {
                                                                    return item > 9 ? item : '0' + item;
                                                                }).join(':'));
                                                            } else {
                            Severity: Major
                            Found in vendor/assets/javascripts/jquery.datetimepicker.js - About 40 mins to fix

                              Consider simplifying this complex logical expression.
                              Open

                              !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
                              Severity: Major
                              Found in vendor/assets/javascripts/jquery.datetimepicker.js - About 40 mins to fix

                                Consider simplifying this complex logical expression.
                                Open

                                                            if ((options.initTime || options.defaultSelect || datetimepicker.data('changed')) && current_time.getHours() === parseInt(h, 10) && (options.step > 59 || current_time.getMinutes() === parseInt(m, 10))) {
                                                                if (options.defaultSelect || datetimepicker.data('changed')) {
                                                                    classes.push('xdsoft_current');
                                                                } else if (options.initTime) {
                                                                    classes.push('xdsoft_init_time');
                                Severity: Major
                                Found in vendor/assets/javascripts/jquery.datetimepicker.js - About 40 mins to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                                              if ((options.minDateTime !== false && options.minDateTime > optionDateTime) || (options.maxTime !== false && _xdsoft_datetime.strtotime(options.maxTime).getTime() < now.getTime()) || (options.minTime !== false && _xdsoft_datetime.strtotime(options.minTime).getTime() > now.getTime())) {
                                                                  classes.push('xdsoft_disabled');
                                                              }
                                  Severity: Major
                                  Found in vendor/assets/javascripts/jquery.datetimepicker.js - About 40 mins to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                                                if ((options.minDateTime !== false && options.minDateTime > optionDateTime) || ((options.disabledMinTime !== false && now.getTime() > _xdsoft_datetime.strtotime(options.disabledMinTime).getTime()) && (options.disabledMaxTime !== false && now.getTime() < _xdsoft_datetime.strtotime(options.disabledMaxTime).getTime()))) {
                                                                    classes.push('xdsoft_disabled');
                                                                }
                                    Severity: Major
                                    Found in vendor/assets/javascripts/jquery.datetimepicker.js - About 40 mins to fix

                                      Consider simplifying this complex logical expression.
                                      Open

                                            if (autoPlace) {
                                              var $parent = this.$element.parent()
                                      
                                              var orgPlacement = placement
                                              var docScroll    = document.documentElement.scrollTop || document.body.scrollTop
                                      Severity: Major
                                      Found in vendor/assets/javascripts/bootstrap.js - About 40 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language