Showing 200 of 421 total issues
Avoid deeply nested control flow statements. Open
Open
if (req.onResourceLoad) {
req.onResourceLoad(context, this.map, this.depMaps);
}
Avoid deeply nested control flow statements. Open
Open
if ( dist < sorted[ i ].dist ) {
sorted.splice( i, 0, { uid: +uid, type: type, dist: dist } );
break;
}
Avoid deeply nested control flow statements. Open
Open
if ((this.events.error && this.map.isDefine) ||
req.onError !== defaultOnError) {
try {
exports = context.execCb(id, factory, depExports, exports);
} catch (e) {
Function __ntuplecomp
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
__ntuplecomp: function (a, b) {
var mlen = Math.max(a.length, b.length);
for (var i = 0; i < mlen; i++) {
if (a[i] < b[i]) return -1;
if (a[i] > b[i]) return 1;
- 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 (headers.hasOwnProperty(header)) {
xhr.setRequestHeader(header.toLowerCase(), headers[header]);
}
Avoid deeply nested control flow statements. Open
Open
if (context_data_position == bitsPerChar - 1) {
context_data_position = 0;
context_data.push(getCharFromInt(context_data_val));
context_data_val = 0;
} else {
Avoid deeply nested control flow statements. Open
Open
if ( !groupStarted ) {
output.push( '<span class="cke_toolgroup" role="presentation">' );
groupStarted = 1;
}
Avoid deeply nested control flow statements. Open
Open
for (i = 0 ; i < 16 ; i++) {
context_data_val = (context_data_val << 1) | (value & 1);
if (context_data_position == bitsPerChar - 1) {
context_data_position = 0;
context_data.push(getCharFromInt(context_data_val));
Avoid deeply nested control flow statements. Open
Open
for (i = 0 ; i < 8 ; i++) {
context_data_val = (context_data_val << 1) | (value & 1);
if (context_data_position == bitsPerChar - 1) {
context_data_position = 0;
context_data.push(getCharFromInt(context_data_val));
Avoid deeply nested control flow statements. Open
Open
if (context_data_position == bitsPerChar - 1) {
context_data_position = 0;
context_data.push(getCharFromInt(context_data_val));
context_data_val = 0;
} else {
Avoid deeply nested control flow statements. Open
Open
for (i = 0 ; i < context_numBits ; i++) {
context_data_val = (context_data_val << 1);
if (context_data_position == bitsPerChar - 1) {
context_data_position = 0;
context_data.push(getCharFromInt(context_data_val));
Avoid deeply nested control flow statements. Open
Open
if (b < be) addCellsInline(node, b++, null, baseTextLines, "delete");
Avoid deeply nested control flow statements. Open
Open
} else if (change == "delete") {
addCellsInline(node, b++, null, baseTextLines, change);
} else {
// equal
addCellsInline(node, b++, n++, baseTextLines, change);
Avoid deeply nested control flow statements. Open
Open
if (n < ne) addCellsInline(node2, null, n++, newTextLines, "insert");
Avoid deeply nested control flow statements. Open
Open
if (idx + 1 == opcodes.length) {
break;
} else {
continue;
}
Avoid deeply nested control flow statements. Open
Open
if (!inline) node.appendChild(ctelt("td", "skip", ""));
Avoid deeply nested control flow statements. Open
Open
if ( upcasted instanceof CKEDITOR.htmlParser.element )
element = upcasted;
Consider simplifying this complex logical expression. Open
Open
if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
(milliseconds <= 0 && days <= 0 && months <= 0))) {
milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
days = 0;
months = 0;
Consider simplifying this complex logical expression. Open
Open
if (deepStringMixin && typeof value === 'object' && value &&
!isArray(value) && !isFunction(value) &&
!(value instanceof RegExp)) {
if (!target[prop]) {
Consider simplifying this complex logical expression. Open
Open
if ((config.maxWordCount > -1 && wordCount > config.maxWordCount && deltaWord > 0) ||
(config.maxCharCount > -1 && charCount > config.maxCharCount && deltaChar > 0)) {
limitReached(editorInstance, limitReachedNotified);
} else if (!limitRestoredNotified &&