Showing 193 of 398 total issues
Avoid deeply nested control flow statements. Open
Open
if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword('in')) {
init = this.finalize(init, new Node.VariableDeclaration(declarations, kind));
this.nextToken();
left = init;
right = this.parseExpression();
Avoid deeply nested control flow statements. Open
Open
if (ch && character_1.Character.isOctalDigit(ch.charCodeAt(0))) {
var octToDec = this.octalToDecimal(ch);
octal = octToDec.octal || octal;
str += String.fromCharCode(octToDec.code);
}
Avoid deeply nested control flow statements. Open
Open
if (this.scanner.isRestrictedWord(id.name)) {
this.tolerateUnexpectedToken(token, messages_1.Messages.StrictLHSAssignment);
}
Avoid deeply nested control flow statements. Open
Open
if (this.source[this.index] === '{') {
++this.index;
str += this.scanUnicodeCodePointEscape();
}
else {
Avoid deeply nested control flow statements. Open
Open
while (--pos >= 0 && RE_VN_CHAR.test(code[pos]));
Avoid deeply nested control flow statements. Open
Open
if (match[1]) {
if (match[1] === ch) ++ix
else if (!--ix) break
} else {
rech.lastIndex = pushQBlock(match.index, rech.lastIndex, match[2])
Avoid deeply nested control flow statements. Open
Open
if (r instanceof ReturnValue){ // break out
if (r.type == 'break') break
result = r
}
Avoid deeply nested control flow statements. Open
Open
if (match[1]) {
if (match[1] === ch) ++ix
else if (!--ix) break
} else {
rech.lastIndex = pushQBlock(match.index, rech.lastIndex, match[2])
Avoid deeply nested control flow statements. Open
Open
while (--pos >= 0 && RE_VN_CHAR.test(code[pos]));
Avoid deeply nested control flow statements. Open
Open
if (~beforeReWords.indexOf(code.slice(pos + 1, end))) {
start = next
}
Avoid deeply nested control flow statements. Open
Open
if (~beforeReWords.indexOf(code.slice(pos + 1, end))) {
start = next
}
Consider simplifying this complex logical expression. Open
Open
if (str === '===' || str === '!==' || str === '>>>' ||
str === '<<=' || str === '>>=' || str === '**=') {
this.index += 3;
}
else {
Function MethodDefinition
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function MethodDefinition(key, computed, value, kind, isStatic) {
Function Primitives
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
function Primitives (context) {
if (this instanceof Primitives) {
this.context = context
for (var i = 0; i < names.length; i++) {
if (!this.context[names[i]]) {
- 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 this.scanIdentifier();
Avoid too many return
statements within this function. Open
Open
return walk(node.consequent)
Avoid too many return
statements within this function. Open
Open
return this.scanPunctuator();
Avoid too many return
statements within this function. Open
Open
return this.scanPunctuator();
Avoid too many return
statements within this function. Open
Open
return walk(node.alternate)
Avoid too many return
statements within this function. Open
Open
return result