Showing 135 of 135 total issues

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

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

          }},Ln.take=function(n,t,r){return n&&n.length?((r?Er(n,t,r):null==t)&&(t=1),St(n,0,0>t?0:t)):[]},Ln.takeRight=function(n,t,r){var e=n?n.length:0;return e?((r?Er(n,t,r):null==t)&&(t=1),t=e-(+t||0),St(n,0>t?0:t)):[]},Ln.takeRightWhile=function(n,t,r){return n&&n.length?$t(n,mr(t,r,3),false,true):[]},Ln.takeWhile=function(n,t,r){return n&&n.length?$t(n,mr(t,r,3)):[]},Ln.tap=function(n,t,r){return t.call(r,n),n},Ln.throttle=function(n,t,r){var e=true,u=true;if(typeof n!="function")throw new ze(L);return false===r?e=false:le(r)&&(e="leading"in r?!!r.leading:e,
      Severity: Minor
      Found in browser/yod.js and 1 other location - About 40 mins to fix
      browser/yod.js on lines 539..539

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

      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

          Ln.defer=Eo,Ln.delay=ko,Ln.difference=Xu,Ln.drop=Pr,Ln.dropRight=Br,Ln.dropRightWhile=function(n,t,r){return n&&n.length?$t(n,mr(t,r,3),true,true):[]},Ln.dropWhile=function(n,t,r){return n&&n.length?$t(n,mr(t,r,3),true):[]},Ln.fill=function(n,t,r,e){var u=n?n.length:0;if(!u)return[];for(r&&typeof r!="number"&&Er(n,t,r)&&(r=0,e=u),u=n.length,r=null==r?0:+r||0,0>r&&(r=-r>u?0:u+r),e=e===w||e>u?u:+e||0,0>e&&(e+=u),u=r>e?0:e>>>0,r>>>=0;r<u;)n[r++]=t;return n},Ln.filter=Xr,Ln.flatten=function(n,t,r){var e=n?n.length:0;
      Severity: Minor
      Found in browser/yod.js and 1 other location - About 40 mins to fix
      browser/yod.js on lines 551..551

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

      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 Rt has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          (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: Minor
      Found in browser/yod.js - About 35 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

          Function wt has 5 arguments (exceeds 4 allowed). Consider refactoring.
          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: Minor
          Found in browser/yod.js - About 35 mins to fix

            Function generator has a Cognitive Complexity of 7 (exceeds 5 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 35 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 too many return statements within this function.
            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 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  for(;u--;)if(n[u]===t)return u;return-1},Ln.max=ui,Ln.min=oi,Ln.noConflict=function(){return _._=Xe,this},Ln.noop=Se,Ln.now=wo,Ln.pad=function(n,t,r){n=u(n),t=+t;var e=n.length;return e<t&&du(t)?(e=(t-e)/2,t=eu(e),e=tu(e),r=sr("",e,r),r.slice(0,t)+n+r):n},Ln.padLeft=Xo,Ln.padRight=Ho,Ln.parseInt=xe,Ln.random=function(n,t,r){r&&Er(n,t,r)&&(t=r=null);var e=null==n,u=null==t;return null==r&&(u&&typeof n=="boolean"?(r=n,n=1):typeof t=="boolean"&&(r=t,u=true)),e&&u&&(t=1,u=false),n=+n||0,u?(t=n,n=0):t=+t||0,
              Severity: Major
              Found in browser/yod.js - About 30 mins to fix

                Avoid too many return statements within this function.
                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 30 mins to fix

                  Avoid too many return statements within this function.
                  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 30 mins to fix

                    Avoid too many return statements within this function.
                    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 30 mins to fix

                      Function isParentOf has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      KVPair.prototype.isParentOf = function(pair) {
                        var node = pair.node;
                        if (this.hasChildPairs) {
                          while (node) {
                            if (node === this.value) {
                      Severity: Minor
                      Found in src/obj/kv-pair.js - About 25 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

                      Function _callConfig has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function _callConfig(caller) {
                        var series = caller.series.slice(1); // Shift '@Config'
                        var ser = series[0];
                        var value = allConfig;
                        if (!ser || ser.args || !value.hasOwnProperty(ser.name)) {
                      Severity: Minor
                      Found in src/obj/str/caller.js - About 25 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

                      Severity
                      Category
                      Status
                      Source
                      Language