Showing 135 of 135 total issues

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 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 _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 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

                    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

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

                        KVPairNode.prototype.findPairByKey = function(key) {
                          return _.find(this.kvPairs, function(pair) {
                            return pair.key === key;
                          });
                        };
                        Severity: Major
                        Found in src/obj/kv-pair-node.js and 1 other location - About 1 hr to fix
                        browser/yod.js on lines 666..670

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

                        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

                            KVPairNode.prototype.findPairByKey = function(key) {
                              return _.find(this.kvPairs, function(pair) {
                                return pair.key === key;
                              });
                            };
                        Severity: Major
                        Found in browser/yod.js and 1 other location - About 1 hr to fix
                        src/obj/kv-pair-node.js on lines 72..76

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

                        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

                        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

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

                              }function dr(n,t,r){var e=r?ku:Eu,u=e,o=u;return Bu(n,function(n,i,a){i=t(n,i,a),((r?i<u:i>u)||i===e&&i===o)&&(u=i,o=n)}),o}function mr(n,t,r){var e=Ln.callback||Ee,e=e===Ee?it:e;return r?e(n,t,r):e}function wr(n,t,e){var u=Ln.indexOf||Mr,u=u===Mr?r:u;return n?u(n,t,e):u}function br(n){var t=n.length,r=new n.constructor(t);return t&&"string"==typeof n[0]&&Ze.call(n,"index")&&(r.index=n.index,r.input=n.input),r}function xr(n){return n=n.constructor,typeof n=="function"&&n instanceof n||(n=Le),new n;
                          Severity: Major
                          Found in browser/yod.js and 1 other location - About 1 hr to fix
                          browser/yod.js on lines 497..497

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

                          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

                          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

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

                                    Ln.endsWith=function(n,t,r){n=u(n),t+="";var e=n.length;return r=r===w?e:bu(0>r?0:+r||0,e),r-=t.length,0<=r&&n.indexOf(t,r)==r},Ln.escape=function(n){return(n=u(n))&&hn.test(n)?n.replace(sn,l):n},Ln.escapeRegExp=be,Ln.every=Jr,Ln.find=fo,Ln.findIndex=Hu,Ln.findKey=Po,Ln.findLast=co,Ln.findLastIndex=Qu,Ln.findLastKey=Bo,Ln.findWhere=function(n,t){return fo(n,xt(t))},Ln.first=zr,Ln.get=function(n,t,r){return n=null==n?w:dt(n,$r(t),t+""),n===w?r:n},Ln.has=function(n,t){if(null==n)return false;var r=Ze.call(n,t);
                                Severity: Minor
                                Found in browser/yod.js and 1 other location - About 55 mins to fix
                                browser/yod.js on lines 569..569

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

                                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

                                    return r}function a(n,t){for(var r=n.length;r--&&-1<t.indexOf(n.charAt(r)););return r}function f(t,r){return n(t.a,r.a)||t.b-r.b}function c(n){return Ln[n]}function l(n){return Pn[n]}function s(n){return"\\"+Mn[n]}function p(n,t,r){var e=n.length;for(t+=r?0:-1;r?t--:++t<e;){var u=n[t];if(u!==u)return t}return-1}function h(n){return!!n&&typeof n=="object"}function _(n){return 160>=n&&9<=n&&13>=n||32==n||160==n||5760==n||6158==n||8192<=n&&(8202>=n||8232==n||8233==n||8239==n||8287==n||12288==n||65279==n);
                                Severity: Minor
                                Found in browser/yod.js and 1 other location - About 55 mins to fix
                                browser/yod.js on lines 450..450

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

                                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

                                Severity
                                Category
                                Status
                                Source
                                Language