Showing 1,229 of 1,229 total issues
Avoid deeply nested control flow statements. Open
Open
if ( elem && elem.parentNode ) {
// Handle the case where IE, Opera, and Webkit return items
// by name instead of ID
if ( elem.id === m ) {
results.push( elem );
Avoid deeply nested control flow statements. Open
Open
if ( cache[1] === true ) {
return true;
}
Function detectDependency
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
function detectDependency(dep, flx) {
var sharing = Object.keys(dep.variable.flxs).length,
modifiers = Object.keys(dep.variable.modifierFlxs).length,
source = dep.source.name,
- 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
Avoid deeply nested control flow statements. Open
Open
if ( name in thisCache ) {
name = [ name ];
} else {
name = name.split(" ");
}
Avoid deeply nested control flow statements. Open
Open
if ( (event.result = ret) === false ) {
event.preventDefault();
event.stopPropagation();
}
Avoid deeply nested control flow statements. Open
Open
if (result.passed) passed++; else failed++;
Function register
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
function register(name, fn, scope) {
function _register(name, fn, scope) {
var _scope = b.objectExpression([]);
if (scope) {
- 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
Avoid deeply nested control flow statements. Open
Open
if (config.adminRoles.indexOf(role) >= 0) { return true; }
Function init
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
init: function( elem, options, prop, end, easing, unit ) {
Avoid deeply nested control flow statements. Open
Open
if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
cur += clazz + " ";
}
Avoid deeply nested control flow statements. Open
Open
if (cQindex === -1) {
LQ.docs.splice(index, 0, doc); //insert the document
} else {
if (cQindex !== index) {
if (cQindex < index) { // if we remove item before, the whole array shifts, so we have to compensate index by 1.
Avoid deeply nested control flow statements. Open
Open
if (_byte === 120) {
_this._parseCSV.nextCharactersAreUnicode = 2;
} else {
_foundEscapedChar = false;
_ref = _this._escapedCharacters;
Avoid deeply nested control flow statements. Open
Open
while ( j-- ) {
if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
elem.removeChild( tbody );
}
}
Avoid deeply nested control flow statements. Open
Open
if ( deleteExpando ) {
delete elem[ internalKey ];
} else if ( typeof elem.removeAttribute !== core_strundefined ) {
elem.removeAttribute( internalKey );
Avoid deeply nested control flow statements. Open
Open
if (cQindex === -1) {
index = getIndexInSorted(doc, LQ.docs, sortBy);
LQ.docs.splice(index, 0, doc);
if (LQ.indexedByMethods.limit) {
if (LQ.docs.length > LQ.indexedByMethods.limit[0]) {
Avoid deeply nested control flow statements. Open
Open
if (_this._parseCSV.nextCharactersAreUnicode === 1) {
_this._parseCSV.firstPartOfHex = sd.write(_byteBuffer);
} else {
_realByteString = _this._parseCSV.firstPartOfHex + sd.write(_byteBuffer);
_realByte = parseInt(_realByteString, 16);
Avoid deeply nested control flow statements. Open
Open
if ( !(unmatched[i] || setMatched[i]) ) {
setMatched[i] = pop.call( results );
}
Avoid deeply nested control flow statements. Open
Open
if ( rscriptType.test( node.type || "" ) &&
!jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
if ( node.src ) {
// Hope ajax is available...
Avoid deeply nested control flow statements. Open
Open
if ( (seed = find(
token.matches[0].replace( runescape, funescape ),
rsibling.test( tokens[0].type ) && context.parentNode || context
)) ) {
Avoid deeply nested control flow statements. Open
Open
if (cQindex === -1) {
LQ.docs.push(doc);
LQ._distributeChange(doc, evName, null);
}