saltstack/salt

View on GitHub
doc/_themes/saltstack/static/js/vendor/modernizr-2.6.2-respond-1.1.0.js

Summary

Maintainability
F
1 wk
Test Coverage

Function Modernizr has 594 lines of code (exceeds 25 allowed). Consider refactoring.
Open

window.Modernizr = (function( window, document, undefined ) {

    var version = '2.6.2',

    Modernizr = {},

    Function Modernizr has a Cognitive Complexity of 115 (exceeds 5 allowed). Consider refactoring.
    Open

    window.Modernizr = (function( window, document, undefined ) {
    
        var version = '2.6.2',
    
        Modernizr = {},

    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

    File modernizr-2.6.2-respond-1.1.0.js has 755 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* Modernizr 2.6.2 (Custom Build) | MIT & BSD
     * Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-mq-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
     */
    ;
    
    

      Function webforms has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function webforms() {
                                                  Modernizr['input'] = (function( props ) {
                  for ( var i = 0, len = props.length; i < len; i++ ) {
                      attrs[ props[i] ] = !!(props[i] in inputElem);
                  }

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

            injectElementWithStyles = function( rule, callback, nodes, testnames ) {
        
              var style, ret, node, docOverflow,
                  div = document.createElement('div'),
                        body = document.body,

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

                  function h(a, b) {
                      function c(a, c) {
                          if (a) {
                              if (e(a)) c || (j = function () {
                                  var a = [].slice.call(arguments);

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

                  Function.prototype.bind = function bind(that) {
            
                    var target = this;
            
                    if (typeof target != "function") {

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

                  isEventSupported = (function() {
              
                    var TAGNAMES = {
                      'select': 'input', 'change': 'input',
                      'submit': 'form', 'reset': 'form',

                Consider simplifying this complex logical expression.
                Open

                            if (!o && g(l.readyState) && (u.r = o = 1, !q && h(), l.onload = l.onreadystatechange = null, b)) {
                                "img" != a && m(function () {
                                    t.removeChild(l)
                                }, 50);
                                for (var d in y[c]) y[c].hasOwnProperty(d) && y[c][d].onload()
                Severity: Major
                Found in doc/_themes/saltstack/static/js/vendor/modernizr-2.6.2-respond-1.1.0.js - About 40 mins to fix

                  Consider simplifying this complex logical expression.
                  Open

                                      else if (Object(a) === a)
                                          for (n in m = function () {
                                              var b = 0,
                                                  c;
                                              for (c in a) a.hasOwnProperty(c) && b++;
                  Severity: Major
                  Found in doc/_themes/saltstack/static/js/vendor/modernizr-2.6.2-respond-1.1.0.js - About 40 mins to fix

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

                        tests['svgclippaths'] = function() {
                            return !!document.createElementNS && /SVGClipPath/.test(toString.call(document.createElementNS(ns.svg, 'clipPath')));
                        };
                    doc/_themes/saltstack/static/js/vendor/modernizr-2.6.2-respond-1.1.0.js on lines 531..533

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

                    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

                        tests['smil'] = function() {
                            return !!document.createElementNS && /SVGAnimate/.test(toString.call(document.createElementNS(ns.svg, 'animate')));
                        };
                    doc/_themes/saltstack/static/js/vendor/modernizr-2.6.2-respond-1.1.0.js on lines 536..538

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

                    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

                        tests['localstorage'] = function() {
                            try {
                                localStorage.setItem(mod, mod);
                                localStorage.removeItem(mod);
                                return true;
                    doc/_themes/saltstack/static/js/vendor/modernizr-2.6.2-respond-1.1.0.js on lines 500..508

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

                    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

                        tests['sessionstorage'] = function() {
                            try {
                                sessionStorage.setItem(mod, mod);
                                sessionStorage.removeItem(mod);
                                return true;
                    doc/_themes/saltstack/static/js/vendor/modernizr-2.6.2-respond-1.1.0.js on lines 490..498

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

                    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

                                            }(), a) a.hasOwnProperty(n) && (!c && !--m && (d(j) ? j = function () {
                                                var a = [].slice.call(arguments);
                                                k.apply(this, a), l()
                                            } : j[n] = function (a) {
                    doc/_themes/saltstack/static/js/vendor/modernizr-2.6.2-respond-1.1.0.js on lines 939..942

                    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

                                        if (e(a)) c || (j = function () {
                                            var a = [].slice.call(arguments);
                                            k.apply(this, a), l()
                                        }), g(a, j, b, 0, h);
                    doc/_themes/saltstack/static/js/vendor/modernizr-2.6.2-respond-1.1.0.js on lines 949..952

                    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

                    There are no issues that match your filters.

                    Category
                    Status