Showing 117 of 330 total issues
Function process
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
DiagramsRenderer.prototype.process = function process(ele) {
const observerConfig = { childList: true };
// get all pre tags with class name = sequence
const seqDiagrams = ele.querySelectorAll('pre.sequence');
// get all pre tags with class name = flow
- 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
if (mxnestingd===0 && pos.length>0 && matrix) {
for (i=0; i<pos.length-1; i+=1) {
let subarr;
if (i>0) mxout += '\\\\';
if (i===0) {
Avoid deeply nested control flow statements. Open
for (i=1; i<len-1; i+=1) {
if (newFrag.charAt(i)===left) mxnestingd+=1;
if (newFrag.charAt(i)===right) {
mxnestingd-=1;
if (mxnestingd===0 && newFrag.charAt(i+2)===',' && newFrag.charAt(i+3)==='{') {
Avoid deeply nested control flow statements. Open
if (matrix) { newFrag = mxout; }
Avoid deeply nested control flow statements. Open
} else if (ignoredAttr.indexOf(arr1[2]) === -1) {
if (arr1[3] !== arr1[4]) {
errorArray.push(line);
}
}
Avoid deeply nested control flow statements. Open
if (!textExpected.has(key) && !textActual.has(key)) {
// If don't have, use helper function to find the contents in the respective
// and compare
if (!helper(key, exp, act)) {
errorArray.push(line);
Avoid deeply nested control flow statements. Open
if (config.AMusedelimiter2) {
arr[i]=arr[i].replace(/AMescape2/g, config.AMdelimiter2).replace(/AMescape1/g, config.AMdelimiter1);
} else {
arr[i]=arr[i].replace(/AMescape1/g, config.AMdelimiter1);
}
Function resolveElement
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
resolveElement(targetReference, altDocument) {
if (typeof targetReference === 'string') {
const doc = altDocument || document;
return doc.getElementById(targetReference);
} else if (targetReference.window === targetReference) {
- 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
if (pos !== -1) {
// Ignore, not an actual error
missedArray.splice(pos, 1);
} else if (arr3[1] !== 'element') {
errorArray.push(line);
Avoid deeply nested control flow statements. Open
if (arr1[3].indexOf('raphael-marker-endblock33-obj') !== -1
&& arr1[4].indexOf('raphael-marker-endblock33-obj') !== -1) {
// Ignore, not an actual error. Just randomly generated id value
} else if ((arr1[3].indexOf('arrowhead') !== -1
&& arr1[4].indexOf('arrowhead') !== -1)) {
Function AMparseMath
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function AMparseMath(str) {
// DLMOD to remove , which editor adds on multiple spaces
str = str.replace(/( |\u00a0| )/g, '');
str = str.replace(/>/g, '>');
str = str.replace(/</g, '<');
- 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
if (textExpected.get(key) !== textActual.get(key)) {
errorArray.push(line);
}
Consider simplifying this complex logical expression. Open
if ((integ && k>1) || k>2) {
st = str.slice(0, k-1);
tagst = 'mn';
} else {
k = 2;
Consider simplifying this complex logical expression. Open
if (state.src.charCodeAt(pos + 1) !== 61 /* = */||
state.src.charCodeAt(pos + 2) !== 62 /* > */ ||
state.src.charCodeAt(pos + 3) !== 104 /* h */ ||
state.src.charCodeAt(pos + 4) !== 105 /* i */ ||
state.src.charCodeAt(pos + 5) !== 100 /* d */ ||
Consider simplifying this complex logical expression. Open
if (state.src.charCodeAt(start) !== 61 /* = */ ||
state.src.charCodeAt(start + 1) !== 62 /* > */ ||
state.src.charCodeAt(start + 2) !== 104 /* h */ ||
state.src.charCodeAt(start + 3) !== 105 /* i */ ||
state.src.charCodeAt(start + 4) !== 100 /* d */ ||
Function createNewFile
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function createNewFile(organizationId, filePath, folderId, newFileId, newFileName) {
Function createNewFolder
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function createNewFolder(organizationId, folderPath, currentFolderId, newFolderId, newFolderName) {
Function injectDataLine
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function injectDataLine(tokens, idx, options, env, slf) {
Function setPrimaryKeys
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
static setPrimaryKeys(...primaryKeys) {
if (isTableInitializedForCreation) {
sqlCreateTableString = stringManipulator.stringConcat(sqlCreateTableString, 'PRIMARY KEY(');
for (let index = 0; index < primaryKeys.length; index += 1) {
if (index === primaryKeys.length - 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
Function setUnique
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
static setUnique(...uniqueKeys) {
if (isTableInitializedForCreation) {
sqlCreateTableString = stringManipulator.stringConcat(sqlCreateTableString, 'UNIQUE(');
for (let index = 0; index < uniqueKeys.length; index += 1) {
if (index === uniqueKeys.length - 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"