Showing 1,251 of 1,982 total issues
File normalize-options.js
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
import corejs3Polyfills from "core-js-compat/data";
import findSuggestion from "levenary";
import invariant from "invariant";
import { coerce, SemVer } from "semver";
Function constructExportCall
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function constructExportCall(
path,
exportIdent,
exportNames,
exportValues,
Function parseMaybeUnary
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
parseMaybeUnary(refExpressionErrors: ?ExpressionErrors): N.Expression {
if (this.isContextual("await") && this.isAwaitAllowed()) {
return this.parseAwait();
} else if (this.state.type.prefix) {
const node = this.startNode();
- 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 parseVar
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
parseVar(
node: N.VariableDeclaration,
isFor: boolean,
kind: "var" | "let" | "const",
): N.VariableDeclaration {
- 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 checkDeclaration
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
checkDeclaration(node: N.Pattern | N.ObjectProperty): void {
if (node.type === "Identifier") {
this.checkDuplicateExports(node, node.name);
} else if (node.type === "ObjectPattern") {
for (const prop of node.properties) {
- 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 finishCallExpression
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
finishCallExpression<T: N.CallExpression | N.OptionalCallExpression>(
node: T,
optional: boolean,
): N.Expression {
if (node.callee.type === "Import") {
- 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 insertAfter
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export function insertAfter(nodes) {
this._assertUnremoved();
nodes = this._verifyNodeList(nodes);
- 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 getConditionalAnnotation
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function getConditionalAnnotation(binding, path, name) {
const ifStatement = getParentConditionalPath(binding, path, name);
if (!ifStatement) return;
const test = ifStatement.get("test");
- 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 BreakStatement|ContinueStatement|ReturnStatement
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
"BreakStatement|ContinueStatement|ReturnStatement"(path, state) {
const { node, scope } = path;
if (node[this.LOOP_IGNORE]) return;
let replace;
- 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 parentheses.js
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as t from "@babel/types";
const PRECEDENCE = {
"||": 0,
"??": 0,
Function readTmplToken
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
readTmplToken(): void {
let out = "",
chunkStart = this.state.pos,
containsInvalid = false;
for (;;) {
Function isExpression
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function isExpression(node: ?Object, opts?: Object): boolean {
if (!node) return false;
const nodeType = node.type;
if (
Function getLetReferences
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
getLetReferences() {
const block = this.block;
let declarators = [];
File analyze-scope.js
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { types as t } from "@babel/core";
import escope from "eslint-scope";
import { Definition } from "eslint-scope/lib/definition";
import OriginalPatternVisitor from "eslint-scope/lib/pattern-visitor";
import OriginalReferencer from "eslint-scope/lib/referencer";
Function defineType
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function defineType(
type: string,
opts: {
fields?: {
[string]: FieldOptions,
Function replaceWith
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function replaceWith(replacement) {
this.resync();
if (this.removed) {
throw new Error("You can't replace this node, we've already removed it");
File configuration.js
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
import buildDebug from "debug";
import path from "path";
import json5 from "json5";
UtilParser
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
export default class UtilParser extends Tokenizer {
// TODO
addExtra(node: Node, key: string, val: any): void {
if (!node) return;
Consider simplifying this complex logical expression. Open
if (
nodeType === "FlowBaseAnnotation" ||
"AnyTypeAnnotation" === nodeType ||
"BooleanTypeAnnotation" === nodeType ||
"NullLiteralTypeAnnotation" === nodeType ||
Consider simplifying this complex logical expression. Open
if (
nodeType === "LVal" ||
"Identifier" === nodeType ||
"MemberExpression" === nodeType ||
"RestElement" === nodeType ||