Showing 117 of 330 total issues
Function AMTparseIexpr
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function AMTparseIexpr(str) {
let sym2;
let node;
let result;
str = AMremoveCharsAndBlanks(str, 0);
- 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 sqlCommands
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export default function sqlCommands() {
this.linkDatabaseToIndexedDB = function linkDatabaseToIndexedDB(databaseName) {
return new Promise((resolve, reject) => {
databaseName = resolveSQLInjection(databaseName);
const databaseRequestStr = stringManipulator.stringConcat(
- 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 changeFolderName
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.changeFolderName = function changeFolderName(folderId, newFolderName) {
return new Promise((resolve, reject) => {
let prevFolderPath;
let thisFolderPath;
let newFolderPath;
Function addEventListeners
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
DocumentNavigator.prototype.addEventListeners = function addEventListeners() {
this.eventInstance = {
pointers: {},
numPointers: 0,
state: {
Function AMprocessNodeR
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function AMprocessNodeR(n, linebreaks) {
let mtch;
let str;
let arr;
let frg;
Function scrollTo
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
scrollTo(destination, duration = 200, callback) {
// Handle case where this code is used in an iframe element
let viewerDoc = this.getDocument(destination);
let viewWindow = this.getWindow(destination);
if (typeof destination === 'number') {
- 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 AMTparseIexpr
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function AMTparseIexpr(str) {
let sym2;
let node;
let result;
str = AMremoveCharsAndBlanks(str, 0);
Function scrollTo
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
scrollTo(destination, duration = 200, callback) {
// Handle case where this code is used in an iframe element
let viewerDoc = this.getDocument(destination);
let viewWindow = this.getWindow(destination);
if (typeof destination === 'number') {
Function deleteFolder
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.deleteFolder = function deleteFolder(folderId) {
return new Promise((resolve, reject) => {
let thisFolderPath;
let foldersToDelete;
let filesToDelete;
Function AMposition
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function AMposition(arr, str, n) {
// return position >=n where str appears or would be inserted
// assumes arr is sorted
let i;
if (n===0) {
- 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 searchFrom
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function searchFrom(frameDoc, direction) {
const x = frameDoc.defaultView.innerWidth/2;
const yLimit = frameDoc.defaultView.innerHeight;
const interval = 10;
- 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 stringManipulation
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function stringManipulation() {
this.stringConcat = function stringConcat(...stringToConcat) {
return stringToConcat.join('');
};
Function addStyle
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
addStyle(frameElement, styleUrl) {
return new Promise((resolve, reject) => {
const frameDoc = this.getDocument(frameElement);
const styleElement = constructStyleLink(frameDoc, styleUrl);
Function shouldPageBreak
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const shouldPageBreak = function shouldPageBreak(eleHeightArray, index, page) {
const BREAK_PAGE = true;
const DO_NOTHING = false;
const element = eleHeightArray[index].ele;
- 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 sqlArray
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export default function sqlArray() {
this.initializeAlasqlArray = function initializeAlasqlArray() {
if (!isAlasqlArrayInitialized) {
sqlObject = {};
isAlasqlArrayInitialized = constants.CONST_ALASQL_CREATION_INITIALIZED;
- 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 creationOfTables
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function creationOfTables() {
return new Promise((resolve, reject) => {
query.isTableExistsInDatabase(constants.ENTITIES_USER)
.then(isUserTableFirstInitialize =>
createUserTable(isUserTableFirstInitialize)
Function updateReferenceFrame
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateReferenceFrame: function updateReferenceFrame(pageRenderer) {
const rf = pageRenderer.referenceFrame;
rf.innerHTML = pageRenderer.sourceHTML;
const pPPFs = pageRenderer.postProcessPromiseFns;
Function AMparseMath
has 34 lines of code (exceeds 25 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, '<');
Consider simplifying this complex logical expression. Open
if (st==='^' || st==='_' || st==='/' || st==='|' || st===','
|| (symbol.input.length===1 && symbol.input.match(/\w/) && st!=='(')) {
return [`{${AMTgetTeXsymbol(symbol)}}`, str];
} else {
node = `{${AMTgetTeXsymbol(symbol)}{${result[0]}}}`;
Consider simplifying this complex logical expression. Open
if ((n.nodeType!==8 || linebreaks) &&
n.parentNode.nodeName!=='form' && n.parentNode.nodeName!=='FORM' &&
n.parentNode.nodeName!=='textarea' && n.parentNode.nodeName!=='TEXTAREA' &&
n.parentNode.nodeName!=='pre' && n.parentNode.nodeName!=='PRE') {
str = n.nodeValue;