Showing 50 of 135 total issues

Function exports has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function (yod, assert, _) {

  yod.type('All', function() { return 'all'; });

  var data = yod({
Severity: Minor
Found in example/5.all.js - About 1 hr to fix

    Function lr has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        n(t,r,de)}}function ir(n){return function(t,r,e){return(typeof r!="function"||e!==w)&&(r=zt(r,e,3)),n(t,r)}}function ar(n){return function(t,r,e){return(t=u(t))&&(n?t:"")+sr(t,r,e)+(n?"":t)}}function fr(n){var t=ie(function(r,e){var u=v(e,t.placeholder);return _r(r,n,null,e,u)});return t}function cr(n,t){return function(r,e,u,o){var i=3>arguments.length;return typeof e=="function"&&o===w&&Uo(r)?n(r,e,u,i):Rt(r,mr(e,o,4),u,i,t)}}function lr(n,t,r,e,u,o,i,a,f,c){function l(){for(var b=arguments.length,j=b,O=Te(b);j--;)O[j]=arguments[j];
    Severity: Major
    Found in browser/yod.js - About 1 hr to fix

      Function object has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              object = function() {
                var key,
                  object = {};
      
                if (ch === '{') {
      Severity: Minor
      Found in browser/yod.js - About 1 hr to fix

        Function exports has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function(yod, assert, _) {
        
          var data = yod({
            a: ['a'],
            b: 'b',
        Severity: Minor
        Found in example/2.object.js - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

              var p="sourceURL"in t?"//# sourceURL="+t.sourceURL+"\n":"";if(n.replace(r,function(t,r,e,u,a,f){return e||(e=u),l+=n.slice(c,f).replace(Sn,s),r&&(o=true,l+="'+__e("+r+")+'"),a&&(i=true,l+="';"+a+";\n__p+='"),e&&(l+="'+((__t=("+e+"))==null?'':__t)+'"),c=f+t.length,t}),l+="';",(t=t.variable)||(l="with(obj){"+l+"}"),l=(i?l.replace(an,""):l).replace(fn,"$1").replace(cn,"$1;"),l="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(o?",__e=_.escape":"")+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}",
              t=ti(function(){return Fe(a,p+"return "+l).apply(w,f)}),t.source=l,ce(t))throw t;return t},Ln.trim=je,Ln.trimLeft=function(n,t,r){var e=n;return(n=u(n))?n.slice((r?Er(e,t,r):null==t)?g(n):i(n,t+"")):n},Ln.trimRight=function(n,t,r){var e=n;return(n=u(n))?(r?Er(e,t,r):null==t)?n.slice(0,y(n)+1):n.slice(0,a(n,t+"")+1):n},Ln.trunc=function(n,t,r){r&&Er(n,t,r)&&(t=null);var e=C;if(r=T,null!=t)if(le(t)){var o="separator"in t?t.separator:o,e="length"in t?+t.length||0:e;r="omission"in t?u(t.omission):r}else e=+t||0;
          Severity: Major
          Found in browser/yod.js - About 1 hr to fix

            Function _r has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                return l}function sr(n,t,r){return n=n.length,t=+t,n<t&&du(t)?(t-=n,r=null==r?" ":r+"",Ae(r,tu(t/r.length)).slice(0,t)):""}function pr(n,t,r,e){function u(){for(var t=-1,a=arguments.length,f=-1,c=e.length,l=Te(a+c);++f<c;)l[f]=e[f];for(;a--;)l[f++]=arguments[++t];return(this&&this!==Zn&&this instanceof u?i:n).apply(o?r:this,l)}var o=t&x,i=Xt(n);return u}function hr(n){return function(t,r,e,u){var o=mr(e);return o===it&&null==e?Pt(t,r,n):Bt(t,r,o(e,u,1),n)}}function _r(n,t,r,e,u,o,i,a){var f=t&A;if(!f&&typeof n!="function")throw new ze(L);
            Severity: Major
            Found in browser/yod.js - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                  return yt(n,de(n))}function de(n){if(null==n)return[];le(n)||(n=Le(n));for(var t=n.length,r=Ln.support,t=t&&Rr(t)&&(Uo(n)||r.nonEnumStrings&&_e(n)||r.nonEnumArgs&&ae(n))&&t||0,e=n.constructor,u=-1,e=Fo(e)&&e.prototype||qe,o=e===n,i=Te(t),a=0<t,f=r.enumErrorProps&&(n===De||n instanceof We),c=r.enumPrototypes&&Fo(n);++u<t;)i[u]=u+"";for(var l in n)c&&"prototype"==l||f&&("message"==l||"name"==l)||a&&Or(l,t)||"constructor"==l&&(o||!Ze.call(n,l))||i.push(l);if(r.nonEnumShadows&&n!==qe)for(t=n===Ke?G:n===De?q:Je.call(n),
                  r=Nu[t]||Nu[Y],t==Y&&(e=qe),t=Wn.length;t--;)l=Wn[t],u=r[l],o&&u||(u?!Ze.call(n,l):n[l]===e[l])||i.push(l);return i}function me(n){return Nt(n,Ko(n))}function we(n){return(n=u(n))&&n.replace(In,c).replace(xn,"")}function be(n){return(n=u(n))&&bn.test(n)?n.replace(wn,"\\$&"):n}function xe(n,t,r){return r&&Er(n,t,r)&&(t=0),ju(n,t)}function Ae(n,t){var r="";if(n=u(n),t=+t,1>t||!n||!du(t))return r;do t%2&&(r+=n),t=eu(t/2),n+=n;while(t);return r}function je(n,t,r){var e=n;return(n=u(n))?(r?Er(e,t,r):null==t)?n.slice(g(n),y(n)+1):(t+="",
              Severity: Major
              Found in browser/yod.js - About 1 hr to fix

                Function vr has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    r[1]=a),t=r[1],a=r[9]),r[9]=null==a?f?0:n.length:wu(a-c,0)||0,(p?qu:Ju)(t==x?Gt(r[0],r[2]):t!=k&&t!=(x|k)||r[4].length?lr.apply(w,r):pr.apply(w,r),r)}function vr(n,t,r,e,u,o,i){var a=-1,f=n.length,c=t.length,l=true;if(f!=c&&(!u||c<=f))return false;for(;l&&++a<f;){var s=n[a],p=t[a],l=w;if(e&&(l=u?e(p,s,a):e(s,p,a)),l===w)if(u)for(var h=c;h--&&(p=t[h],!(l=s&&s===p||r(s,p,e,u,o,i))););else l=s&&s===p||r(s,p,e,u,o,i)}return!!l}function gr(n,t,r){switch(r){case M:case D:return+n==+t;case q:return n.name==t.name&&n.message==t.message;
                Severity: Major
                Found in browser/yod.js - About 50 mins to fix

                  Function yr has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      case V:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case Z:case G:return n==t+""}return false}function yr(n,t,r,e,u,o,i){var a=Ko(n),f=a.length,c=Ko(t).length;if(f!=c&&!u)return false;for(var c=u,l=-1;++l<f;){var s=a[l],p=u?s in t:Ze.call(t,s);if(p){var h=n[s],_=t[s],p=w;e&&(p=u?e(_,h,s):e(h,_,s)),p===w&&(p=h&&h===_||r(h,_,e,u,o,i))}if(!p)return false;c||(c="constructor"==s)}return c||(r=n.constructor,e=t.constructor,!(r!=e&&"constructor"in n&&"constructor"in t)||typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)?true:false;
                  Severity: Major
                  Found in browser/yod.js - About 50 mins to fix

                    Function at has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        }function at(n,t,r,e,u,o,i){var a;if(r&&(a=u?r(n,e,u):r(n)),a!==w)return a;if(!le(n))return n;if(e=Uo(n)){if(a=br(n),!t)return Kn(n,a)}else{var f=Je.call(n),c=f==K;if(f!=Y&&f!=B&&(!c||u))return Nn[f]?Ar(n,f,t):u?n:{};if(Gn(n))return u?n:{};if(a=xr(c?{}:n),!t)return Lu(a,n)}for(o||(o=[]),i||(i=[]),u=o.length;u--;)if(o[u]==n)return i[u];return o.push(n),i.push(a),(e?Vn:vt)(n,function(e,u){a[u]=at(e,t,r,u,n,o,i)}),a}function ft(n,t,r){if(typeof n!="function")throw new ze(L);return lu(function(){n.apply(w,r);
                    Severity: Major
                    Found in browser/yod.js - About 50 mins to fix

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

                          return u}}function mt(n,t,r,e,u,o){if(n===t)return 0!==n||1/n==1/t;var i=typeof n,a=typeof t;if("function"!=i&&"object"!=i&&"function"!=a&&"object"!=a||null==n||null==t)n=n!==n&&t!==t;else n:{var i=mt,a=Uo(n),f=Uo(t),c=z,l=z;a||(c=Je.call(n),c==B?c=Y:c!=Y&&(a=ve(n))),f||(l=Je.call(t),l==B?l=Y:l!=Y&&ve(t));var s=c==Y&&!Gn(n),f=l==Y&&!Gn(t),l=c==l;if(!l||a||s){if(!e&&(c=s&&Ze.call(n,"__wrapped__"),f=f&&Ze.call(t,"__wrapped__"),c||f)){n=i(c?n.value():n,f?t.value():t,r,e,u,o);break n}if(l){for(u||(u=[]),
                      Severity: Minor
                      Found in browser/yod.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                          if (!isFinite(hex)) {
                                            break;
                                          }
                        Severity: Major
                        Found in browser/yod.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                              var p=i[l],h=p.iteratee,_=p.type;if(_==F){if(p.done&&(e?u>p.index:u<p.index)&&(p.count=0,p.done=false),p.index=u,!(p.done||(_=p.limit,p.done=-1<_?p.count++>=_:!h(s))))continue n}else if(p=h(s),_==$)s=p;else if(!p){if(_==N)continue n;break n}}c[f++]=s}return c},Ln.prototype.chain=function(){return Zr(this)},Ln.prototype.commit=function(){return new Bn(this.value(),this.__chain__)},Ln.prototype.plant=function(n){for(var t,r=this;r instanceof Pn;){var e=Lr(r);t?u.__wrapped__=e:t=e;var u=e,r=r.__wrapped__;
                          Severity: Major
                          Found in browser/yod.js - About 45 mins to fix

                            Function config has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function config(key, val, meta) {
                            
                              var keys, lastKey, addMeta;
                            
                              addMeta = _reMeta.test(key);
                            Severity: Minor
                            Found in src/config.js - About 45 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

                                o||(o=[]),c=u.length;c--;)if(u[c]==n){n=o[c]==t;break n}u.push(n),o.push(t),n=(a?vr:yr)(n,t,i,r,e,u,o),u.pop(),o.pop()}else n=false}else n=gr(n,t,c)}return n}function wt(n,t,r,e,u){for(var o=-1,i=t.length,a=!u;++o<i;)if(a&&e[o]?r[o]!==n[t[o]]:!(t[o]in n))return false;for(o=-1;++o<i;){var f=t[o],c=n[f],l=r[o];if(a&&e[o]?f=c!==w||f in n:(f=u?u(c,l,f):w,f===w&&(f=mt(l,c,u,true))),!f)return false}return true}function bt(n,t){var r=-1,e=Zu(n),u=Rr(e)?Te(e):[];return Bu(n,function(n,e,o){u[++r]=t(n,e,o)}),u}function xt(n){
                            Severity: Major
                            Found in browser/yod.js - About 45 mins to fix

                              Consider simplifying this complex logical expression.
                              Open

                                  }),u}function ht(n,t,r){for(var e=-1,u=n.length,o=-1,i=[];++e<u;){var a=n[e];if(h(a)&&Rr(a.length)&&(Uo(a)||ae(a))){t&&(a=ht(a,t,r));var f=-1,c=a.length;for(i.length+=c;++f<c;)i[++o]=a[f]}else r||(i[++o]=a)}return i}function _t(n,t){Mu(n,t,de)}function vt(n,t){return Mu(n,t,Ko)}function gt(n,t){return Du(n,t,Ko)}function yt(n,t){for(var r=-1,e=t.length,u=-1,o=[];++r<e;){var i=t[r];Fo(n[i])&&(o[++u]=i)}return o}function dt(n,t,r){if(null!=n){n=Nr(n),r!==w&&r in n&&(t=[r]),r=-1;for(var e=t.length;null!=n&&++r<e;)var u=n=Nr(n)[t[r]];
                              Severity: Major
                              Found in browser/yod.js - About 40 mins to fix

                                Consider simplifying this complex logical expression.
                                Open

                                    r[1]=a),t=r[1],a=r[9]),r[9]=null==a?f?0:n.length:wu(a-c,0)||0,(p?qu:Ju)(t==x?Gt(r[0],r[2]):t!=k&&t!=(x|k)||r[4].length?lr.apply(w,r):pr.apply(w,r),r)}function vr(n,t,r,e,u,o,i){var a=-1,f=n.length,c=t.length,l=true;if(f!=c&&(!u||c<=f))return false;for(;l&&++a<f;){var s=n[a],p=t[a],l=w;if(e&&(l=u?e(p,s,a):e(s,p,a)),l===w)if(u)for(var h=c;h--&&(p=t[h],!(l=s&&s===p||r(s,p,e,u,o,i))););else l=s&&s===p||r(s,p,e,u,o,i)}return!!l}function gr(n,t,r){switch(r){case M:case D:return+n==+t;case q:return n.name==t.name&&n.message==t.message;
                                Severity: Major
                                Found in browser/yod.js - About 40 mins to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                      if(!n||!n.length)return[];null!=t&&typeof t!="boolean"&&(u=e,e=Er(n,t,u)?null:t,t=false);var o=mr();if((o!==it||null!=e)&&(e=o(e,u,3)),t&&wr()==r){t=e;var i;e=-1,u=n.length;for(var o=-1,a=[];++e<u;){var f=n[e],c=t?t(f,e,n):f;e&&i===c||(i=c,a[++o]=f)}n=a}else n=Ft(n,e);return n}function Vr(n){for(var t=-1,r=(n&&n.length&&Qn(Hn(n,Zu)))>>>0,e=Te(r);++t<r;)e[t]=Hn(n,Ot(t));return e}function Yr(n,t){var r=-1,e=n?n.length:0,u={};for(!e||t||Uo(n[0])||(t=[]);++r<e;){var o=n[r];t?u[o]=t[r]:o&&(u[o[0]]=o[1])}
                                  Severity: Major
                                  Found in browser/yod.js - About 40 mins to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                        break n}}u=t.b-r.b}return u})}function Wt(n,t){var r=0;return Bu(n,function(n,e,u){r+=+t(n,e,u)||0}),r}function Ft(n,t){var e=-1,u=wr(),o=n.length,i=u==r,a=i&&200<=o,f=a?Ku():null,c=[];f?(u=qn,i=false):(a=false,f=t?[]:c);n:for(;++e<o;){var l=n[e],s=t?t(l,e,n):l;if(i&&l===l){for(var p=f.length;p--;)if(f[p]===s)continue n;t&&f.push(s),c.push(l)}else 0>u(f,s,0)&&((t||a)&&f.push(s),c.push(l))}return c}function Nt(n,t){for(var r=-1,e=t.length,u=Te(e);++r<e;)u[r]=n[t[r]];return u}function $t(n,t,r,e){for(var u=n.length,o=e?u:-1;(e?o--:++o<u)&&t(n[o],o,n););
                                    Severity: Major
                                    Found in browser/yod.js - About 40 mins to fix

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

                                          }}function jt(n,t,r,e,u){if(!le(n))return n;var o=Rr(t.length)&&(Uo(t)||ve(t));if(!o){var i=Ko(t);iu.apply(i,Gu(t))}return Vn(i||t,function(a,f){if(i&&(f=a,a=t[f]),h(a)){e||(e=[]),u||(u=[]);n:{for(var c=f,l=e,s=u,p=l.length,_=t[c];p--;)if(l[p]==_){n[c]=s[p];break n}var p=n[c],v=r?r(p,_,c,n,t):w,g=v===w;g&&(v=_,Rr(_.length)&&(Uo(_)||ve(_))?v=Uo(p)?p:Zu(p)?Kn(p):[]:No(_)||ae(_)?v=ae(p)?ge(p):No(p)?p:{}:g=false),l.push(_),s.push(v),g?n[c]=jt(v,_,r,l,s):(v===v?v!==p:p===p)&&(n[c]=v)}}else c=n[f],l=r?r(c,a,f,n,t):w,
                                      Severity: Minor
                                      Found in browser/yod.js - About 35 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language