app/assets/javascripts/lib/modernizr.js
Function Modernizr
has a Cognitive Complexity of 112 (exceeds 5 allowed). Consider refactoring. Open
Open
window.Modernizr = (function( window, document, undefined ) {
var version = '2.8.3',
Modernizr = {},
- Read upRead up
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
Open
window.Modernizr = (function( window, document, undefined ) {
var version = '2.8.3',
Modernizr = {},
File modernizr.js
has 384 lines of code (exceeds 250 allowed). Consider refactoring. Open
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
*/
;
Function injectElementWithStyles
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
injectElementWithStyles = function( rule, callback, nodes, testnames ) {
var style, ret, node, docOverflow,
div = document.createElement('div'),
body = document.body,
Function isEventSupported
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
isEventSupported = (function() {
var TAGNAMES = {
'select': 'input', 'change': 'input',
'submit': 'form', 'reset': 'form',
Function bind
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Function.prototype.bind = function bind(that) {
var target = this;
if (typeof target != "function") {