Showing 236 of 328 total issues
Function wrapTrackingFunction
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function wrapTrackingFunction(range, loc, preserveWhitespace) {
return function (parseFunction) {
function isBinary(node) {
Function SourceNode_toStringWithSourceMap
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
var generated = {
code: "",
line: 1,
column: 0
Function SourceMapConsumer_parseMappings
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
var generatedLine = 1;
var previousGeneratedColumn = 0;
var previousOriginalLine = 0;
var previousOriginalColumn = 0;
Function parseArrayInitialiser
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parseArrayInitialiser() {
var elements = [], blocks = [], filter = null, tmp, possiblecomprehension = true, body;
expect('[');
while (!match(']')) {
Consider simplifying this complex logical expression. Open
Open
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) {
Function 28
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{"./xjs":29,"esprima-fb":6,"jstransform/src/utils":20}],28:[function(_dereq_,module,exports){
/**
* Copyright 2013-2014 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Function traverse
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function traverse(node, path, state) {
// Create a scope stack entry if this is the first node we've encountered in
// its local scope
var parentNode = path[0];
if (!Array.isArray(node) && state.localScope.parentNode !== parentNode) {
Function parsePrimaryExpression
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parsePrimaryExpression() {
var type, token;
token = lookahead;
type = lookahead.type;
Function 10
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{"./util":16,"amdefine":17}],10:[function(_dereq_,module,exports){
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
Method filtering_block
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
def filtering_block
if options['select'].present?
select = /#{options['select']}/
end
- 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 binaryPrecedence
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function binaryPrecedence(token, allowIn) {
var prec = 0;
if (token.type !== Token.Punctuator && token.type !== Token.Keyword) {
return 0;
Function 21
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{"./docblock":18}],21:[function(_dereq_,module,exports){
/**
* Copyright 2013 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Function parseFunctionSourceElements
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parseFunctionSourceElements() {
var sourceElement, sourceElements = [], token, directive, firstRestricted,
oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, oldParenthesizedCount;
expect('{');
Function write
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Buffer.prototype.write = function (string, offset, length, encoding) {
// Support both (string, offset, length, encoding)
// and the legacy (string, encoding, offset, length)
if (isFinite(offset)) {
if (!isFinite(length)) {
Function SourceMapGenerator_applySourceMap
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile) {
// If aSourceFile is omitted, we will use the file property of the SourceMap
if (!aSourceFile) {
aSourceFile = aSourceMapConsumer.file;
}
Function visitClassFunctionExpression
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function visitClassFunctionExpression(traverse, node, path, state) {
var methodNode = path[0];
state = utils.updateState(state, {
methodFuncNode: node
Function reinterpretAsCoverFormalsList
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function reinterpretAsCoverFormalsList(expressions) {
var i, len, param, params, defaults, defaultCount, options, rest;
params = [];
defaults = [];
Function advance
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function advance() {
var ch;
if (!state.inXJSChild) {
skipComment();
Function SourceMapGenerator_serializeMappings
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function SourceMapGenerator_serializeMappings() {
var previousGeneratedColumn = 0;
var previousGeneratedLine = 1;
var previousOriginalColumn = 0;
var previousOriginalLine = 0;
Function parseObjectProperty
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parseObjectProperty() {
var token, key, id, value, param;
token = lookahead;