Showing 1,251 of 1,982 total issues
Printer
has 42 functions (exceeds 20 allowed). Consider refactoring. Open
export default class Printer {
constructor(format, map) {
this.format = format || {};
this._buf = new Buffer(map);
}
Function convertNodes
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
function convertNodes(ast, code) {
const astTransformVisitor = {
noScope: true,
enter(path) {
const { node } = path;
- 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 parseExprOp
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
parseExprOp(
left: N.Expression,
leftStartPos: number,
leftStartLoc: Position,
minPrec: 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
File options.js
has 399 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
import type { ConfigItem } from "../item";
import Plugin from "../plugin";
Function pushTask
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
function pushTask(taskName, taskDir, suite, suiteName) {
const taskDirStats = fs.statSync(taskDir);
let actualLoc = findFile(taskDir + "/input");
let execLoc = findFile(taskDir + "/exec");
Function checkExport
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
checkExport(
node: N.ExportNamedDeclaration,
checkNames?: boolean,
isDefault?: boolean,
isFrom?: boolean,
- 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
File lval.js
has 390 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
import * as charCodes from "charcodes";
import { types as tt, type TokenType } from "../tokenizer/types";
import type {
Function processComment
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
processComment(node: Node): void {
if (node.type === "Program" && node.body.length > 0) return;
const stack = this.state.commentStack;
Function parseSubscript
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
parseSubscript(
base: N.Expression,
startPos: number,
startLoc: Position,
noCalls: ?boolean,
- 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 cloneNode
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
export default function cloneNode<T: Object>(
node: T,
deep: boolean = true,
withoutLoc: boolean = false,
): T {
- 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 buildFieldsInitNodes
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function buildFieldsInitNodes(
ref,
superRef,
props,
privateNamesMap,
Function convertFunctionParams
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function convertFunctionParams(
path,
loose,
shouldTransformParam,
replaceRestElement,
Function parseClassMemberWithIsStatic
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseClassMemberWithIsStatic(
classBody: N.ClassBody,
member: N.ClassMember,
state: { hadConstructor: boolean },
isStatic: boolean,
Function hoistFunctionEnvironment
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
function hoistFunctionEnvironment(
fnPath,
specCompliant = false,
allowInsertArrow = true,
) {
Function run
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
function run(task) {
const {
actual,
expect: expected,
exec,
Consider simplifying this complex logical expression. Open
if (
nodeType === "BlockParent" ||
"BlockStatement" === nodeType ||
"CatchClause" === nodeType ||
"DoWhileStatement" === nodeType ||
Function loadFullConfig
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default gensync<[any], ResolvedConfig | null>(function* loadFullConfig(
inputOpts: mixed,
): Handler<ResolvedConfig | null> {
const result = yield* loadPrivatePartialConfig(inputOpts);
if (!result) {
Function OptionalCallExpression|OptionalMemberExpression
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
"OptionalCallExpression|OptionalMemberExpression"(path) {
const { scope } = path;
// maybeParenthesized points to the outermost parenthesizedExpression
// or the path itself
let maybeParenthesized = path;
Function removeTypeDuplicates
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
export default function removeTypeDuplicates(
nodes: Array<Object>,
): Array<Object> {
const generics = {};
const bases = {};
- 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 default
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
export default function (
_: any,
{ corejs, include, exclude, polyfillTargets, debug }: InternalPluginOptions,
) {
const polyfills = filterItems(
- 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"