Showing 1,251 of 1,982 total issues
Function Class
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
Class(path, state) {
if (this.file.get(versionKey) !== version) return;
verifyUsedFeatures(path, this.file);
Function exports
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function () {
return {
name: "babel-source",
load(id) {
const matches = id.match(/packages\/(babel-[^/]+)\/src\//);
- 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 parseSubscript
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseSubscript(
base: N.Expression,
startPos: number,
startLoc: Position,
noCalls: ?boolean,
Function parseParenAndDistinguishExpression
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseParenAndDistinguishExpression(canBeArrow: boolean): N.Expression {
const startPos = this.state.start;
const startLoc = this.state.startLoc;
let val;
File corejs2-built-in-features.js
has 338 lines of code (exceeds 250 allowed). Consider refactoring. Open
const typedArrayMethods = [
"typed arrays / %TypedArray%.from",
"typed arrays / %TypedArray%.of",
"typed arrays / %TypedArray%.prototype.subarray",
"typed arrays / %TypedArray%.prototype.join",
Function readNumber
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
readNumber(startsWithDot: boolean): void {
const start = this.state.pos;
let isFloat = false;
let isBigInt = false;
let isNonOctalDecimalInt = false;
- 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 parseParenAndDistinguishExpression
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
parseParenAndDistinguishExpression(canBeArrow: boolean): N.Expression {
const startPos = this.state.start;
const startLoc = this.state.startLoc;
let val;
- 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 placeholderVisitorHandler
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
function placeholderVisitorHandler(
node: BabelNode,
ancestors: TraversalAncestors,
state: MetadataState,
) {
- 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 introspection.js
has 336 lines of code (exceeds 250 allowed). Consider refactoring. Open
// This file contains methods responsible for introspecting the current path for certain values.
import type NodePath from "./index";
import includes from "lodash/includes";
import * as t from "@babel/types";
Consider simplifying this complex logical expression. Open
if (
nodeType === "JSX" ||
"JSXAttribute" === nodeType ||
"JSXClosingElement" === nodeType ||
"JSXElement" === nodeType ||
File option-assertions.js
has 333 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
import type {
ConfigFileSearch,
BabelrcSearch,
Function wrapClosure
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
wrapClosure() {
if (this.throwIfClosureRequired) {
throw this.blockPath.buildCodeFrameError(
"Compiling let/const in this block would add a closure " +
"(throwIfClosureRequired).",
Function getPolyfillPlugins
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
export const getPolyfillPlugins = ({
useBuiltIns,
corejs,
polyfillTargets,
include,
- 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 328 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-env jest */
import * as babel from "@babel/core";
import { buildExternalHelpers } from "@babel/core";
import getFixtures from "@babel/helper-fixtures";
import sourceMap from "source-map";
Function checkLVal
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
checkLVal(
expr: Expression,
bindingType: BindingTypes = BIND_NONE,
checkClashes: ?{ [key: string]: boolean },
contextDescription: string,
File evaluation.js
has 326 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type NodePath from "./index";
// This file contains Babels metainterpreter that can evaluate static code.
const VALID_CALLEES = ["String", "Number", "Math"];
Function getHelperMetadata
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getHelperMetadata(file) {
const globals = new Set();
const localBindingNames = new Set();
// Maps imported identifier -> helper name
const dependencies = new Map();
Function getLocalExportMetadata
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getLocalExportMetadata(
programPath: NodePath,
loose: boolean,
): Map<string, LocalExportMetadata> {
const bindingKindLookup = new Map();
Function valueToNode
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
export default function valueToNode(value: any): Object {
// undefined
if (value === undefined) {
return identifier("undefined");
}
- 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 defineType
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
export default function defineType(
type: string,
opts: {
fields?: {
[string]: FieldOptions,
- 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"