Showing 193 of 398 total issues
Function _skipRegex
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _skipRegex (code, start) {
// `exec()` will extract from the slash to the end of line and the
// chained `match()` will match the possible regex.
var re = /.*/g
Function parseArrayInitializer
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Parser.prototype.parseArrayInitializer = function () {
var node = this.createNode();
var elements = [];
this.expect('[');
while (!this.match(']')) {
Function scanBinaryLiteral
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Scanner.prototype.scanBinaryLiteral = function (start) {
var number = '';
var ch;
while (!this.eof()) {
ch = this.source[this.index];
Function scanIdentifier
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Scanner.prototype.scanIdentifier = function () {
var type;
var start = this.index;
// Backslash (U+005C) starts an escaped character.
var id = (this.source.charCodeAt(start) === 0x5C) ? this.getComplexIdentifier() : this.getIdentifier();
Function _wrapExpr
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _wrapExpr (expr, asText, key) {
var tb
expr = expr.replace(JS_VARNAME, function (match, p, mvar, pos, s) {
if (mvar) {
Function parseSwitchStatement
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Parser.prototype.parseSwitchStatement = function () {
var node = this.createNode();
this.expectKeyword('switch');
this.expect('(');
var discriminant = this.parseExpression();
Function _wrapExpr
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _wrapExpr (expr, asText, key) {
var tb;
expr = expr.replace(JS_VARNAME, function (match, p, mvar, pos, s) {
if (mvar) {
Function checkPatternParam
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Parser.prototype.checkPatternParam = function (options, param) {
switch (param.type) {
case syntax_1.Syntax.Identifier:
this.validateParam(options, param, param.name);
break;
Function parseDirectivePrologues
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Parser.prototype.parseDirectivePrologues = function () {
var firstRestricted = null;
var body = [];
while (true) {
var token = this.lookahead;
Function _wrapExpr
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _wrapExpr (expr, asText, key) {
var tb
expr = expr.replace(JS_VARNAME, function (match, p, mvar, pos, s) {
if (mvar) {
Function _wrapExpr
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _wrapExpr (expr, asText, key) {
var tb
expr = expr.replace(JS_VARNAME, function (match, p, mvar, pos, s) {
if (mvar) {
Consider simplifying this complex logical expression. Open
Open
if (cp === 60 || cp === 62 || cp === 47 || cp === 58 || cp === 61 || cp === 123 || cp === 125) {
var value = this.scanner.source[this.scanner.index++];
return {
type: token_1.Token.Punctuator,
value: value,
Consider simplifying this complex logical expression. Open
Open
if (this.match('+') || this.match('-') || this.match('~') || this.match('!') ||
this.matchKeyword('delete') || this.matchKeyword('void') || this.matchKeyword('typeof')) {
var node = this.startNode(this.lookahead);
var token = this.nextToken();
expr = this.inheritCoverGrammar(this.parseUnaryExpression);
Function Property
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function Property(kind, key, computed, value, method, shorthand) {
Avoid deeply nested control flow statements. Open
Open
if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) {
this.tolerateError(messages_1.Messages.InvalidLHSInForIn);
}
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 (arrow) {
break;
}
Avoid deeply nested control flow statements. Open
Open
if (!arrow) {
if (!this.context.isBindingElement) {
this.throwUnexpectedToken(this.lookahead);
}
if (expr.type === syntax_1.Syntax.SequenceExpression) {
Avoid deeply nested control flow statements. Open
Open
else if (ch === 0x2A) {
this.index += 2;
var comment = this.skipMultiLineComment();
if (this.trackComment) {
comments = comments.concat(comment);
Avoid deeply nested control flow statements. Open
Open
if (ch === '\r' && this.source[this.index] === '\n') {
++this.index;
}