Showing 99 of 254 total issues
Function generateNumber
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function generateNumber(value) {
var result, point, temp, exponent, pos;
if (value !== value) {
throw new Error('Numeric literal whose value is NaN');
}
Function TryStatement
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
TryStatement: function (stmt, flags) {
var result, i, iz, guardedHandlers;
result = [
'try',
this.maybeBlock(stmt.block, S_TFFF)
Function ObjectExpression
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ObjectExpression: function (expr, precedence, flags) {
var multiline, result, fragment, that = this;
if (!expr.properties.length) {
return '{}';
}
Function SourceMapGenerator_serializeMappings
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {
var previousGeneratedColumn = 0;
var previousGeneratedLine = 1;
var previousOriginalColumn = 0;
var previousOriginalLine = 0;
Function Program
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Program: function (stmt, flags) {
var result, fragment, i, iz, bodyFlags;
iz = stmt.body.length;
result = [safeConcatenation && iz > 0 ? '\n' : ''];
bodyFlags = S_TFTF;
Function ExportNamedDeclaration
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ExportNamedDeclaration: function (stmt, flags) {
var result = ['export'], bodyFlags, that = this;
bodyFlags = flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF;
if (stmt.declaration) {
return join(result, this.generateStatement(stmt.declaration, bodyFlags));
Function ObjectPattern
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ObjectPattern: function (expr, precedence, flags) {
var result, i, iz, multiline, property, that = this;
if (!expr.properties.length) {
return '{}';
}
Function getDefaultOptions
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getDefaultOptions() {
return {
indent: null,
base: null,
parse: null,
Function generateRegExp
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function generateRegExp(reg) {
var match, result, flags, i, iz, ch, characterInBrack, previousIsBackslash;
result = reg.toString();
if (reg.source) {
match = result.match(/\/([^\/]*)$/);
Function normalize
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function normalize(aPath) {
var path = aPath;
var url = urlParse(aPath);
if (url) {
if (!url.path) {
Function exports
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
Function SourceMapGenerator_fromSourceMap
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
var sourceRoot = aSourceMapConsumer.sourceRoot;
var generator = new SourceMapGenerator({
file: aSourceMapConsumer.file,
sourceRoot: sourceRoot
Function runFactory
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function runFactory(id, deps, factory) {
var r, e, m, result;
if (id) {
e = loaderCache[id] = {};
m = {
Function ArrayExpression
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ArrayExpression: function (expr, precedence, flags, isPattern) {
var result, multiline, that = this;
if (!expr.elements.length) {
return '[]';
}
Consider simplifying this complex logical expression. Open
Open
if (fragment.charCodeAt(0) === 123 || isClassPrefixed(fragment) || isFunctionPrefixed(fragment) || isAsyncPrefixed(fragment) || directive && flags & F_DIRECTIVE_CTX && stmt.expression.type === Syntax.Literal && typeof stmt.expression.value === 'string') {
result = [
'(',
result,
')' + this.semicolon(flags)
Consider simplifying this complex logical expression. Open
Open
if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) {
return;
} else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aOriginal && 'line' in aOriginal && 'column' in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) {
return;
} else {
Function ComprehensionExpression
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ComprehensionExpression: function (expr, precedence, flags) {
var result, i, iz, fragment, that = this;
result = expr.type === Syntax.GeneratorExpression ? ['('] : ['['];
if (extra.moz.comprehensionExpressionStartsWithAssignment) {
fragment = this.generateExpression(expr.body, Precedence.Assignment, E_TTT);
Function escapeString
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function escapeString(str) {
var result = '', i, len, code, singleQuotes = 0, doubleQuotes = 0, single, quote;
for (i = 0, len = str.length; i < len; ++i) {
code = str.charCodeAt(i);
if (code === 39) {
Function generateFunctionParams
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
CodeGenerator.prototype.generateFunctionParams = function (node) {
var i, iz, result, hasDefault;
hasDefault = false;
if (node.type === Syntax.ArrowFunctionExpression && !node.rest && (!node.defaults || node.defaults.length === 0) && node.params.length === 1 && node.params[0].type === Syntax.Identifier) {
result = [
Function SwitchCase
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
SwitchCase: function (stmt, flags) {
var result, fragment, i, iz, bodyFlags, that = this;
withIndent(function () {
if (stmt.test) {
result = [