Showing 50 of 135 total issues

File yod.js has 1110 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/******/ (function(modules) { // webpackBootstrap
/******/     // The module cache
/******/     var installedModules = {};

/******/     // The require function
Severity: Major
Found in browser/yod.js - About 2 days to fix

    Function jsonfy has 181 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        var jsonfy = (function() {
    
          var at,     // The index of the current character
            ch,     // The current character
            endChars = ':,}]',
    Severity: Major
    Found in browser/yod.js - About 7 hrs to fix

      Function parse has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
      Open

      function parse (str) {
      
        var tpl = '';
        var callerStack = [];
        var pairs = {
      Severity: Minor
      Found in src/obj/str/engine.js - About 4 hrs 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

      Function parse has 97 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function parse (str) {
      
            var tpl = '';
            var callerStack = [];
            var pairs = {
      Severity: Major
      Found in browser/yod.js - About 3 hrs to fix

        Function parse has 97 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function parse (str) {
        
          var tpl = '';
          var callerStack = [];
          var pairs = {
        Severity: Major
        Found in src/obj/str/engine.js - About 3 hrs to fix

          Function m has 91 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              }function v(n,t){for(var r=-1,e=n.length,u=-1,o=[];++r<e;)n[r]===t&&(n[r]=P,o[++u]=r);return o}function g(n){for(var t=-1,r=n.length;++t<r&&_(n.charCodeAt(t)););return t}function y(n){for(var t=n.length;t--&&_(n.charCodeAt(t)););return t}function d(n){return Bn[n]}function m(_){function Ln(n){if(h(n)&&!(Uo(n)||n instanceof zn)){if(n instanceof Bn)return n;if(Ze.call(n,"__chain__")&&Ze.call(n,"__wrapped__"))return Lr(n)}return new Bn(n)}function Pn(){}function Bn(n,t,r){this.__wrapped__=n,this.__actions__=r||[],
              this.__chain__=!!t}function zn(n){this.__wrapped__=n,this.__actions__=null,this.__dir__=1,this.__filtered__=false,this.__iteratees__=null,this.__takeCount__=ku,this.__views__=null}function Mn(){this.__data__={}}function Dn(n){var t=n?n.length:0;for(this.data={hash:yu(null),set:new cu};t--;)this.push(n[t])}function qn(n,t){var r=n.data;return(typeof t=="string"||le(t)?r.set.has(t):r.hash[t])?0:-1}function Kn(n,t){var r=-1,e=n.length;for(t||(t=Te(e));++r<e;)t[r]=n[r];return t}function Vn(n,t){for(var r=-1,e=n.length;++r<e&&false!==t(n[r],r,n););
              return n}function Yn(n,t){for(var r=-1,e=n.length;++r<e;)if(!t(n[r],r,n))return false;return true}function Xn(n,t){for(var r=-1,e=n.length,u=-1,o=[];++r<e;){var i=n[r];t(i,r,n)&&(o[++u]=i)}return o}function Hn(n,t){for(var r=-1,e=n.length,u=Te(e);++r<e;)u[r]=t(n[r],r,n);return u}function Qn(n){for(var t=-1,r=n.length,e=Eu;++t<r;){var u=n[t];u>e&&(e=u)}return e}function nt(n,t){for(var r=-1,e=n.length;++r<e;)if(t(n[r],r,n))return true;return false}function tt(n,t){return n===w?t:n}function rt(n,t,r,e){return n!==w&&Ze.call(e,r)?n:t;
          
              }function et(n,t,r){var e=Ko(t);iu.apply(e,Gu(t));for(var u=-1,o=e.length;++u<o;){var i=e[u],a=n[i],f=r(a,t[i],i,n,t);(f===f?f===a:a!==a)&&(a!==w||i in n)||(n[i]=f)}return n}function ut(n,t){for(var r=-1,e=n.length,u=Rr(e),o=t.length,i=Te(o);++r<o;){var a=t[r];i[r]=u?Or(a,e)?n[a]:w:n[a]}return i}function ot(n,t,r){r||(r={});for(var e=-1,u=t.length;++e<u;){var o=t[e];r[o]=n[o]}return r}function it(n,t,r){var e=typeof n;return"function"==e?t===w?n:zt(n,t,r):null==n?Ie:"object"==e?xt(n):t===w?Ce(n):At(n,t);
          Severity: Major
          Found in browser/yod.js - About 3 hrs to fix

            Consider simplifying this complex logical expression.
            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,
                (s=l===w)&&(l=a),!o&&l===w||!s&&(l===l?l===c:c!==c)||(n[f]=l)}),n}function Ot(n){return function(t){return null==t?w:Nr(t)[n]}}function Et(n){var t=n+"";return n=$r(n),function(r){return dt(r,n,t)}}function kt(n,t){for(var r=t.length;r--;){var e=parseFloat(t[r]);if(e!=u&&Or(e)){var u=e;su.call(n,e,1)}}}function It(n,t){return n+eu(Ou()*(t-n+1))}function Rt(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function St(n,t,r){var e=-1,u=n.length;for(t=null==t?0:+t||0,0>t&&(t=-t>u?0:u+t),
            Severity: Critical
            Found in browser/yod.js - About 3 hrs to fix

              Consider simplifying this complex logical expression.
              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=[]),
                  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: Critical
              Found in browser/yod.js - About 3 hrs to fix

                Consider simplifying this complex logical expression.
                Open

                    }}),zn.prototype.compact=function(){return this.filter(Ie)},zn.prototype.reject=function(n,t){return n=mr(n,t,1),this.filter(function(t){return!n(t)})},zn.prototype.slice=function(n,t){n=null==n?0:+n||0;var r=0>n?this.takeRight(-n):this.drop(n);return t!==w&&(t=+t||0,r=0>t?r.dropRight(-t):r.take(t-n)),r},zn.prototype.toArray=function(){return this.drop(0)},vt(zn.prototype,function(n,t){var r=Ln[t];if(r){var e=/^(?:filter|map|reject)|While$/.test(t),u=/^(?:first|last)$/.test(t);Ln.prototype[t]=function(){
                    function t(n){return n=[n],iu.apply(n,o),r.apply(Ln,n)}var o=arguments,i=this.__chain__,a=this.__wrapped__,f=!!this.__actions__.length,c=a instanceof zn,l=o[0],s=c||Uo(a);return s&&e&&typeof l=="function"&&1!=l.length&&(c=s=false),c=c&&!f,u&&!i?c?n.call(a):r.call(Ln,this.value()):s?(a=n.apply(c?a:new zn(this),o),u||!f&&!a.__actions__||(a.__actions__||(a.__actions__=[])).push({func:Gr,args:[t],thisArg:Ln}),new Bn(a,i)):this.thru(t)}}}),Vn("concat join pop push replace shift sort splice split unshift".split(" "),function(n){
                Severity: Critical
                Found in browser/yod.js - About 2 hrs to fix

                  Function getValue has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                  Caller.prototype.getValue = function(pairStack) {
                    // 解析每个 Caller 中的参数的值
                    _.each(this.series, function(ser) {
                      _.each(ser.args || [], function(arg, i) {
                        if (arg instanceof Caller) {
                  Severity: Minor
                  Found in src/obj/str/caller.js - About 1 hr 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

                  Function getValue has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                  KVPair.prototype.getValue = function(stack) {
                    _recycleCheck(this, stack);
                    stack.push(this);
                    var val = this.value;
                  
                  
                  Severity: Minor
                  Found in src/obj/kv-pair.js - About 1 hr 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

                  Consider simplifying this complex logical expression.
                  Open

                      return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=null),r}}function ue(n,t,r){function e(){var r=t-(wo()-c);0>=r||r>t?(a&&ru(a),r=p,a=s=p=w,r&&(h=wo(),f=n.apply(l,i),s||a||(i=l=null))):s=lu(e,r)}function u(){s&&ru(s),a=s=p=w,(v||_!==t)&&(h=wo(),f=n.apply(l,i),s||a||(i=l=null))}function o(){if(i=arguments,c=wo(),l=this,p=v&&(s||!g),false===_)var r=g&&!s;else{a||g||(h=c);var o=_-(c-h),y=0>=o||o>_;y?(a&&(a=ru(a)),h=c,f=n.apply(l,i)):a||(a=lu(u,o))}return y&&s?s=ru(s):s||t===_||(s=lu(e,t)),r&&(y=true,f=n.apply(l,i)),
                  Severity: Critical
                  Found in browser/yod.js - About 1 hr to fix

                    Function string has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            string = function() {
                              var hex,
                                i,
                                string = '',
                                start = ch === '"' || ch === '\'' ? ch : '',
                    Severity: Minor
                    Found in browser/yod.js - About 1 hr to fix

                      Function create has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          modifier.create = function(filters, name, fn, ctx) {
                            if (_.isString(filters)) {
                              ctx = fn;
                              fn = name;
                              name = filters;
                      Severity: Minor
                      Found in browser/yod.js - About 1 hr to fix

                        Function create has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        modifier.create = function(filters, name, fn, ctx) {
                          if (_.isString(filters)) {
                            ctx = fn;
                            fn = name;
                            name = filters;
                        Severity: Minor
                        Found in src/tm/modifier.js - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                              n=Nr(n);for(var r=-1,e=t.length,u={};++r<e;){var o=t[r];o in n&&(u[o]=n[o])}return u}function Tr(n,t){var r={};return _t(n,function(n,e,u){t(n,e,u)&&(r[e]=n)}),r}function Ur(n){var t,r=Ln.support;if(!h(n)||Je.call(n)!=Y||Gn(n)||!(Ze.call(n,"constructor")||(t=n.constructor,typeof t!="function"||t instanceof t))||!r.argsTag&&ae(n))return false;var e;return r.ownLast?(_t(n,function(n,t,r){return e=Ze.call(r,t),false}),false!==e):(_t(n,function(n,t){e=t}),e===w||Ze.call(n,e))}function Wr(n){for(var t=de(n),r=t.length,e=r&&n.length,u=Ln.support,u=e&&Rr(e)&&(Uo(n)||u.nonEnumStrings&&_e(n)||u.nonEnumArgs&&ae(n)),o=-1,i=[];++o<r;){
                          Severity: Critical
                          Found in browser/yod.js - About 1 hr to fix

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

                            function _callDepend(caller, pairStack) {
                              var pair = _.last(pairStack);
                            
                              if (!pair) { throw new Error(caller + ' not a object.'); }
                              var node = pair.node;
                            Severity: Minor
                            Found in src/obj/str/caller.js - About 1 hr to fix

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

                              modifier.generator = function(prevGenerator, name, args, ctx) {
                                var mod = all[name],
                                  fn;
                              
                                args = args || [];
                              Severity: Minor
                              Found in src/tm/modifier.js - About 1 hr to fix

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

                                    function _callDepend(caller, pairStack) {
                                      var pair = _.last(pairStack);
                                
                                      if (!pair) { throw new Error(caller + ' not a object.'); }
                                      var node = pair.node;
                                Severity: Minor
                                Found in browser/yod.js - About 1 hr to fix

                                  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
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language