Showing 1,251 of 1,982 total issues
Function VariableDeclarator
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
VariableDeclarator(path, file) {
if (!path.get("id").isObjectPattern()) {
return;
}
Function flowEnumBody
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
flowEnumBody(node: N.Node, { enumName, nameLoc }): N.Node {
const explicitType = this.flowEnumParseExplicitType({ enumName });
this.expect(tt.braceL);
const members = this.flowEnumMembers({ enumName, explicitType });
Function exit
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
exit(path) {
const {
scope,
seen,
imported,
Function buildJSXElementCall
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildJSXElementCall(path, file) {
const openingPath = path.get("openingElement");
openingPath.parent.children = t.react.buildChildren(openingPath.parent);
const tagExpr = convertJSXIdentifier(
File options.js
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
import fs from "fs";
import commander from "commander";
Function convertNodes
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
function convertNodes(ast, code) {
const astTransformVisitor = {
noScope: true,
enter(path) {
const { node } = path;
Function Program
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Program(path, state) {
const { file } = state;
let fileJsxPragma = null;
if (!GLOBAL_TYPES.has(path.node)) {
Function CallExpression
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
CallExpression(path) {
if (!hasArgumentPlaceholder(path.node)) {
return;
}
const { node, scope } = path;
Function isReactCall
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function isReactCall(path) {
// If the callee is not a member expression, then check if it matches
// a named import, e.g. `import {forwardRef} from 'react'`.
if (!t.isMemberExpression(path.node.callee)) {
const callee = path.get("callee");
- 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 parseSwitchStatement
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
parseSwitchStatement(node: N.SwitchStatement): N.SwitchStatement {
this.next();
node.discriminant = this.parseHeaderExpression();
const cases = (node.cases = []);
this.expect(tt.braceL);
- 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 transformFile
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function* transformFile(file: File, pluginPasses: PluginPasses): Handler<void> {
for (const pluginPairs of pluginPasses) {
const passPairs = [];
const passes = [];
const visitors = [];
- 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 resolveStandardizedName
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function resolveStandardizedName(
type: "plugin" | "preset",
name: string,
dirname: string = process.cwd(),
) {
- 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 applyTargetDecorators
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function applyTargetDecorators(path, state, decoratedProps) {
const name = path.scope.generateDeclaredUidIdentifier(
path.isClass() ? "class" : "obj",
);
- 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 verify
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export function verify(visitor) {
if (visitor._verified) return;
if (typeof visitor === "function") {
throw new Error(
- 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 config-descriptors.js
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
import { loadPlugin, loadPreset } from "./files";
import { getItemDescriptor } from "./item";
Function parseImportSpecifier
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseImportSpecifier(node: N.ImportDeclaration): void {
const specifier = this.startNode();
const firstIdentLoc = this.state.start;
const firstIdent = this.parseIdentifier(true);
Function placeholderVisitorHandler
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
function placeholderVisitorHandler(
node: BabelNode,
ancestors: TraversalAncestors,
state: MetadataState,
) {
Function readEscapedChar
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
readEscapedChar(inTemplate: boolean): string | null {
const throwOnInvalid = !inTemplate;
const ch = this.input.charCodeAt(++this.state.pos);
++this.state.pos;
switch (ch) {
Function convertTemplateType
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
function convertTemplateType(tokens) {
let curlyBrace = null;
let templateTokens = [];
const result = [];
Function parseExprOp
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseExprOp(
left: N.Expression,
leftStartPos: number,
leftStartLoc: Position,
minPrec: number,