Showing 27 of 99 total issues
Function exports
has 202 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
'use strict';
// load grunt dependencies
require('load-grunt-tasks')(grunt);
Function runHyphenTest
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function runHyphenTest() {
if (!document.body && !document.getElementsByTagName('body')[0]) {
setTimeout(runHyphenTest, waitTime);
return;
}
Function metadata
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function metadata(cb) {
var tests = [];
var md = new MarkdownIt();
file.walkSync(viewRoot, function(start, dirs, files) {
files.forEach(function(file) {
Consider simplifying this complex logical expression. Open
Open
if (!isSVG) {
/**
* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
*/
;(function(window, document) {
File html5printshiv.js
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
define(['isSVG'], function(isSVG) {
/**
* @optionName html5printshiv
* @optionProp html5printshiv
*/
Function options
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function options(cb, allMetadata) {
var opts;
file.walkSync(srcRoot, function(start, dirs, files) {
opts = _.chain(files)
Function shivPrint
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function shivPrint(ownerDocument) {
var shivedSheet,
wrappers,
data = getExpandoData(ownerDocument),
namespaces = ownerDocument.namespaces,
Consider simplifying this complex logical expression. Open
Open
if (!isSVG) {
/**
* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
*/
;(function(window, document) {
Function build
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function build(generate, generateBanner, pkg) {
return function build(config, cb) {
var requireConfig = {};
var banner;
config = config || {};
Function build
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return function build(config, cb) {
var requireConfig = {};
var banner;
config = config || {};
cb = cb || function noop() {};
Function testProps
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function testProps(props, prefixed, value, skipValueTest) {
skipValueTest = is(skipValueTest, 'undefined') ? false : skipValueTest;
// Try native detect first
if (!is(value, 'undefined')) {
Function generate
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return function generate(config) {
// Set some defaults
if (!config) {
config = {};
}
Consider simplifying this complex logical expression. Open
Open
if (Modernizr._config.usePrefix) {
BlobBuilder = BlobBuilder || window.MozBlobBuilder || window.WebKitBlobBuilder || window.MSBlobBuilder || window.OBlobBuilder;
URL = URL || window.MozURL || window.webkitURL || window.MSURL || window.OURL;
}
Function injectElementWithStyles
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function injectElementWithStyles(rule, callback, nodes, testnames) {
var mod = 'modernizr';
var style;
var ret;
var node;
Function test_hyphens_find
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function test_hyphens_find(delimiter) {
try {
/* create a sample input for resetting selection location, and a div container
* these have to be appended to document.body, otherwise some browsers can give false negative
* div container gets the doubled testword, separated by the delimiter
Function testRunner
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function testRunner() {
var featureNames;
var feature;
var aliasIdx;
var result;
Function test_hyphens
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function test_hyphens(delimiter, testWidth) {
try {
/* create a div container and a span within that
* these have to be appended to document.body, otherwise some browsers can give false negative */
var div = createElement('div');
Function addTest
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function addTest(feature, test) {
if (typeof feature === 'object') {
for (var key in feature) {
if (hasOwnProp(feature, key)) {
Function exports
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
'use strict';
// load grunt dependencies
require('load-grunt-tasks')(grunt);
- 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 generateBuildQuery
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return function generateBuildQuery(config) {
// Format:
// ?-<prop1>-<prop2>-…-<propN>-<option1>-<option2>-…<optionN>[-dontmin][-cssclassprefix:<prefix>]
// where prop1…N and option1…N are sorted alphabetically (for consistency)
var dontmin = !config.minify;