Showing 2,064 of 4,422 total issues
Avoid deeply nested control flow statements. Open
Open
if (m.css) { css = (css ? css + ";" : "") + m.css; }
Avoid deeply nested control flow statements. Open
Open
{ if (oldCur[k].marker == span.marker) { continue spans } }
Avoid deeply nested control flow statements. Open
Open
if (dir < 0 ? preventCursorRight : preventCursorLeft)
{ near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }
Avoid deeply nested control flow statements. Open
Open
if (this.buffer.charAt(i) !== foundCurrentBuffer.charAt(i)) {
existingLength = i
break
}
Function _upload
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
_upload: function(id, params){
this._options.onUpload(id, this.getName(id), true);
var file = this._files[id],
name = this.getName(id),
- 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 (cropped) {
minCanvasWidth = cropBox.width;
minCanvasHeight = cropBox.height;
if (minCanvasHeight * aspectRatio > minCanvasWidth) {
Avoid deeply nested control flow statements. Open
Open
if (cutTop && cutBot) {
display.view = display.view.slice(0, cutTop.index)
.concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))
.concat(display.view.slice(cutBot.index));
display.viewTo += lendiff;
Avoid deeply nested control flow statements. Open
Open
if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\d+)$/)) {
if (indexOf(newGroup, Number(m[1])) > -1) {
lst(newChanges)[prop] = change[prop];
delete change[prop];
}
Avoid deeply nested control flow statements. Open
Open
if (keywords.propertyIsEnumerable(word)) {
var kw = keywords[word]
return ret(kw.type, kw.style, word)
}
Avoid deeply nested control flow statements. Open
Open
if (!loose) loose = next;
Avoid deeply nested control flow statements. Open
Open
if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))
{ collapsed = sp; }
Avoid deeply nested control flow statements. Open
Open
if (pos == 0) return
Avoid deeply nested control flow statements. Open
Open
if (bull !== b && !(bull.length > 1 && b.length > 1)) {
src = cap.slice(i + 1).join('\n') + src;
i = l - 1;
}
Avoid deeply nested control flow statements. Open
Open
} else if (sp.from > pos && nextChange > sp.from) {
nextChange = sp.from;
}
Avoid deeply nested control flow statements. Open
Open
if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))
{ return skipAtomicInner(doc, near, pos, dir, mayClear) }
Function _disableDropOutside
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
_disableDropOutside: function(e){
// run only once for all instances
if (!qq.UploadDropZone.dropOutsideDisabled ){
// for these cases we need to catch onDrop to reset dropArea
- 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 (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }
Avoid deeply nested control flow statements. Open
Open
if (word == "async" && stream.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/, false))
return ret("async", "keyword", word)
Avoid deeply nested control flow statements. Open
Open
} else if (opening && (next.length === 0 || /\s/.test(next) || closeBefore.indexOf(next) > -1)) {
curType = "both";
} else {
return CodeMirror.Pass;
}
Avoid deeply nested control flow statements. Open
Open
for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}