Showing 1,229 of 1,229 total issues
Avoid deeply nested control flow statements. Open
Open
if (_byte === 0x78) {
_this._parseCSV.nextCharactersAreUnicode = 2;
} else {
_foundEscapedChar = false;
_ref = _this._escapedCharacters;
Avoid deeply nested control flow statements. Open
Open
}else if(methodName === 'populate'){
opts.populate.push(args);
}
Avoid deeply nested control flow statements. Open
Open
} else if (_byte === 0x5C) {
_this._parseCSV.nextCharCouldBeEscaped = true;
} else if (_byte === 0x22) {
_key = sd.write(new Buffer(_this._parseCSV.remainingBytes));
_this._parseCSV.remainingBytes = [];
Avoid deeply nested control flow statements. Open
Open
if ( (elem = matcherOut[i]) ) {
// Restore matcherIn since elem is not yet a final match
temp.push( (matcherIn[i] = elem) );
}
Avoid deeply nested control flow statements. Open
Open
if ( xhrOnUnloadAbort ) {
delete xhrCallbacks[ handle ];
}
Avoid deeply nested control flow statements. Open
Open
if ( !xhrCallbacks ) {
xhrCallbacks = {};
jQuery( window ).unload( xhrOnUnloadAbort );
}
Avoid deeply nested control flow statements. Open
Open
if (tree.dep[j].name === tree.ids[i].id) {
// console.log(" - ", tree.dep[j]);
_down.push(j);
}
Avoid deeply nested control flow statements. Open
Open
for ( conv2 in converters ) {
// If conv2 outputs current
tmp = conv2.split(" ");
if ( tmp[ 1 ] === current ) {
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
for (var k = 0; k < tree.dep.length; k++) {
for (var m = 0; m < tree.dep[i].names.length; m++) { var name = tree.dep[i].names[m];
if (name === tree.dep[k].to) {
tree.dep[k].index = m;
tree.dep[k].to = tree.dep[i].name;
Avoid deeply nested control flow statements. Open
Open
for ( type in data.events ) {
if ( special[ type ] ) {
jQuery.event.remove( elem, type );
// This is a shortcut to avoid jQuery.event.remove's overhead
Avoid deeply nested control flow statements. Open
Open
if ( hasScripts ) {
jQuery.merge( scripts, getAll( node, "script" ) );
}
Avoid deeply nested control flow statements. Open
Open
} else if (_byte === 92) {
_this._parseCSV.nextCharCouldBeEscaped = true;
} else if (_byte === 34) {
_key = sd.write(new Buffer(_this._parseCSV.remainingBytes));
_this._parseCSV.remainingBytes = [];
Avoid deeply nested control flow statements. Open
Open
if ( Expr.relative[ tokens[j].type ] ) {
break;
}
Avoid deeply nested control flow statements. Open
Open
if ( conv && s["throws"] ) {
response = conv( response );
} else {
try {
response = conv( response );
Avoid deeply nested control flow statements. Open
Open
if ( xhr.readyState !== 4 ) {
xhr.abort();
}
Avoid deeply nested control flow statements. Open
Open
if ( typeof xhr.responseText === "string" ) {
responses.text = xhr.responseText;
}
Avoid deeply nested control flow statements. Open
Open
if (cQindex === -1) {
LQ.docs.push(doc);
LQ._distributeChange(doc, evName, true); //doc wasn't in the result, but after update is
} else {
Function extractUp
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
function extractUp(tree, id) {
var _n = {};
var __n = {};
var _d = {};
- 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 (methodName === 'sort' && opts.count) {
throw new Error('Mongoose does not support sort and count in one query'); //TODO remove when we update to mongoose 3.9.2
}