Showing 1,251 of 1,982 total issues
File index.js
has 4141 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
/*
* This file is auto-generated! Do not modify it directly.
* To re-generate run 'make build'
*/
File flow.js
has 2874 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
/*:: declare var invariant; */
import type Parser from "../parser";
File index.js
has 2147 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
/*:: declare var invariant; */
import type { TokenType } from "../../tokenizer/types";
File expression.js
has 1967 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
// A recursive descent parser operates by defining functions for all
// syntactic elements, and recursively calling those, each function
// advancing the input stream and returning an AST node. Precedence
Function helper
has a Cognitive Complexity of 244 (exceeds 5 allowed). Consider refactoring. Open
export function helper(babel, options) {
const FILE_NAME_VAR = "_jsxFileName";
const JSX_SOURCE_ANNOTATION_REGEX = /\*?\s*@jsxImportSource\s+([^\s]+)/;
const JSX_RUNTIME_ANNOTATION_REGEX = /\*?\s*@jsxRuntime\s+([^\s]+)/;
- 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 statement.js
has 1765 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
import * as N from "../types";
import { types as tt, type TokenType } from "../tokenizer/types";
import ExpressionParser from "./expression";
File helpers.js
has 1587 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
import template from "@babel/template";
const helpers = Object.create(null);
Function helper
has 662 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function helper(babel, options) {
const FILE_NAME_VAR = "_jsxFileName";
const JSX_SOURCE_ANNOTATION_REGEX = /\*?\s*@jsxImportSource\s+([^\s]+)/;
const JSX_RUNTIME_ANNOTATION_REGEX = /\*?\s*@jsxRuntime\s+([^\s]+)/;
Function transformClass
has a Cognitive Complexity of 160 (exceeds 5 allowed). Consider refactoring. Open
export default function transformClass(
path: NodePath,
file: any,
builtinClasses: ReadonlySet<string>,
isLoose: 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 index.js
has 1242 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
/*:: declare var invariant; */
import type { Options } from "../options";
File index.js
has 1223 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
/*
* This file is auto-generated! Do not modify it directly.
* To re-generate run 'make build'
*/
File types.js
has 1100 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
import type { SourceType } from "./options";
import type { Token } from "./tokenizer";
import type { SourceLocation } from "./util/location";
Function transformClass
has 532 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function transformClass(
path: NodePath,
file: any,
builtinClasses: ReadonlySet<string>,
isLoose: boolean,
File index.js
has 1053 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
/*
* This file is auto-generated! Do not modify it directly.
* To re-generate run 'make build'
*/
Function _evaluate
has a Cognitive Complexity of 131 (exceeds 5 allowed). Consider refactoring. Open
function _evaluate(path, state) {
if (!state.confident) return;
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
File core.js
has 1046 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
import is from "../validators/is";
import isValidIdentifier from "../validators/isValidIdentifier";
import { isKeyword, isReservedWord } from "@babel/helper-validator-identifier";
Consider simplifying this complex logical expression. Open
if (
nodeType === "Flow" ||
"AnyTypeAnnotation" === nodeType ||
"ArrayTypeAnnotation" === nodeType ||
"BooleanTypeAnnotation" === nodeType ||
Function _generateImport
has a Cognitive Complexity of 105 (exceeds 5 allowed). Consider refactoring. Open
_generateImport(opts, importName) {
const isDefault = importName === "default";
const isNamed = !!importName && !isDefault;
const isNamespace = importName === null;
- 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
Consider simplifying this complex logical expression. Open
if (
nodeType === "Statement" ||
"BlockStatement" === nodeType ||
"BreakStatement" === nodeType ||
"ContinueStatement" === nodeType ||
File index.js
has 799 lines of code (exceeds 250 allowed). Consider refactoring. Open
import includes from "lodash/includes";
import repeat from "lodash/repeat";
import Renamer from "./lib/renamer";
import type NodePath from "../path";
import traverse from "../index";