kandanapp/kandan

View on GitHub
app/assets/javascripts/lib/modernizr.js

Summary

Maintainability
F
5 days
Test Coverage

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

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

    var version = '2.8.3',

    Modernizr = {},
Severity: Minor
Found in app/assets/javascripts/lib/modernizr.js - About 2 days 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 Modernizr has 379 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    var version = '2.8.3',

    Modernizr = {},
Severity: Major
Found in app/assets/javascripts/lib/modernizr.js - About 1 day to fix

    File modernizr.js has 384 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* Modernizr 2.8.3 (Custom Build) | MIT & BSD
     * Build: http://modernizr.com/download/#-draganddrop-audio-touch-shiv-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-notification
     */
    ;
    
    
    Severity: Minor
    Found in app/assets/javascripts/lib/modernizr.js - About 5 hrs to fix

      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,
      Severity: Minor
      Found in app/assets/javascripts/lib/modernizr.js - About 1 hr to fix

        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',
        Severity: Minor
        Found in app/assets/javascripts/lib/modernizr.js - About 1 hr to fix

          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") {
          Severity: Minor
          Found in app/assets/javascripts/lib/modernizr.js - About 1 hr to fix

            There are no issues that match your filters.

            Category
            Status