Showing 117 of 330 total issues
Function rename
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
Folder.prototype.rename = function rename(newFolderName) {
if (!(this instanceof Folder)) {
throw new Error(ERROR_NOT_FOLDER_INSTANCE);
}
- 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 too many return
statements within this function. Open
Open
return true;
Avoid too many return
statements within this function. Open
Open
return true;
Avoid too many return
statements within this function. Open
Open
return [`{\\quad\\text{${symbol.input}}\\quad}`, str];
Avoid too many return
statements within this function. Open
Open
return storage.renameFile(this.id, newFileName)
.then(() => {
const oldFileName = this.name;
this.name = newFileName;
this.path = this.path.replace(oldFileName, newFileName);
Avoid too many return
statements within this function. Open
Open
return [symbol.output, str];
Avoid too many return
statements within this function. Open
Open
return DO_NOTHING;
Avoid too many return
statements within this function. Open
Open
return [newFrag, str];
Avoid too many return
statements within this function. Open
Open
return [node, result[1]];
Avoid too many return
statements within this function. Open
Open
return [node, result[1]];
Avoid too many return
statements within this function. Open
Open
return false;
Avoid too many return
statements within this function. Open
Open
return BREAK_PAGE;
Avoid too many return
statements within this function. Open
Open
return new Promise((resolve, reject) => reject(ERROR_SAME_FOLDER_NAME));
Avoid too many return
statements within this function. Open
Open
return storage.renameFolder(this.id, newFolderName)
.then(() => {
const oldFolderName = this.name;
this.name = newFolderName;
this.path = this.path.replace(oldFolderName, newFolderName);
Avoid too many return
statements within this function. Open
Open
return [`\\sqrt{${result[0]}}`, result[1]];
Avoid too many return
statements within this function. Open
Open
if (result2[0]==null) return [`{${AMTgetTeXsymbol(symbol)}}`, str];
Avoid too many return
statements within this function. Open
Open
return [`{${AMTgetTeXsymbol(symbol)}}`, str];
Avoid too many return
statements within this function. Open
Open
return [`${AMTgetTeXsymbol(symbol)}{${result[0]}}`, result[1]];
Avoid too many return
statements within this function. Open
Open
return [`{${AMTgetTeXsymbol(symbol)}{${result[0]}}}`, result[1]];
Avoid too many return
statements within this function. Open
Open
return [newFrag, result2[1]];