Showing 1,251 of 1,982 total issues
Function readInt
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
readInt(
radix: number,
len?: number,
forceLen?: boolean,
allowNumSeparator: boolean = true,
Function getReferenceOrigin
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export default function getReferenceOrigin(
node,
scope,
) /*: ?ReferenceOrigin */ {
if (node.type === "Identifier") {
- 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 adjustCommentsAfterTrailingComma
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
adjustCommentsAfterTrailingComma(
node: Node,
elements: (Node | null)[],
// When the current node is followed by a token which hasn't a respective AST node, we
// need to take all the trailing comments to prevent them from being attached to an
- 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 codeFrameColumns
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export function codeFrameColumns(
rawLines: string,
loc: NodeLocation,
opts: Object = {},
): string {
- 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 enableFeature
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export function enableFeature(file, feature, loose) {
// We can't blindly enable the feature because, if it was already set,
// "loose" can't be changed, so that
// @babel/plugin-class-properties { loose: true }
// @babel/plugin-class-properties { loose: 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 getMarkerLines
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function getMarkerLines(
loc: NodeLocation,
source: Array<string>,
opts: Object,
): { start: number, end: number, markerLines: Object } {
- 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 generateCode
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export default function generateCode(
pluginPasses: PluginPasses,
file: File,
): {
outputCode: string,
- 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 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
import assert from "assert";
import * as t from "@babel/types";
import template from "@babel/template";
import chunk from "lodash/chunk";
Function output
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
async output(summary) {
const goodnews = [
summary.allowed.success.length + " valid programs parsed without error",
summary.allowed.failure.length +
" invalid programs produced a parsing error",
Function parseMaybeAssign
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseMaybeAssign(
noIn?: ?boolean,
refExpressionErrors?: ?ExpressionErrors,
afterLeftParse?: Function,
refNeedsArrowPos?: ?Pos,
Function applyReplacement
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function applyReplacement(
placeholder: Placeholder,
ast: BabelNodeFile,
replacement: any,
) {
Function classTransformer
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function classTransformer(
path: NodePath,
file,
builtinClasses: ReadonlySet<string>,
isLoose: boolean,
Function exports
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function () {
return {
name: "babel-source",
load(id) {
const matches = id.match(/packages\/(babel-[^/]+)\/src\//);
Function buildMappingData
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildMappingData(map: SourceMap): ResolvedMappings {
const consumer = new sourceMap.SourceMapConsumer({
...map,
// This is a bit hack. .addMapping expects source values to be relative,
Function recurseDescriptors
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ignored = yield* (function* recurseDescriptors(
config: {
plugins: Array<UnloadedDescriptor>,
presets: Array<UnloadedDescriptor>,
},
File missing-plugin-helper.js
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
const pluginNameMap = {
classProperties: {
syntax: {
Consider simplifying this complex logical expression. Open
if (
nodeType === "Pureish" ||
"FunctionDeclaration" === nodeType ||
"FunctionExpression" === nodeType ||
"StringLiteral" === nodeType ||
File rewrite-live-references.js
has 277 lines of code (exceeds 250 allowed). Consider refactoring. Open
import assert from "assert";
import * as t from "@babel/types";
import template from "@babel/template";
import simplifyAccess from "@babel/helper-simple-access";
Function readNumber
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
readNumber(startsWithDot: boolean): void {
const start = this.state.pos;
let isFloat = false;
let isBigInt = false;
let isNonOctalDecimalInt = false;
Function isFlow
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function isFlow(node: ?Object, opts?: Object): boolean {
if (!node) return false;
const nodeType = node.type;
if (