Showing 1,251 of 1,982 total issues
Consider simplifying this complex logical expression. Open
if (
nodeType === "Expression" ||
"ArrayExpression" === nodeType ||
"AssignmentExpression" === nodeType ||
"BinaryExpression" === nodeType ||
Function default
has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring. Open
export default function (
_: any,
{
corejs,
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
Function default
has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring. Open
export default function (
{ types: t }: { types: Object },
{ include, exclude, polyfillTargets, debug }: InternalPluginOptions,
) {
const polyfills = filterItems(
- 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
StatementParser
has 86 functions (exceeds 20 allowed). Consider refactoring. Open
export default class StatementParser extends ExpressionParser {
// ### Statement parsing
// Parse a program. Initializes the parser, reads any number of
// statements, and wraps them in a Program node. Optionally takes a
Function default
has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring. Open
export default function (opts) {
const visitor = {};
visitor.JSXNamespacedName = function (path) {
if (opts.throwIfNamespace) {
- 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 es2015.js
has 694 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
import defineType, {
assertShape,
assertNodeType,
assertValueType,
File index.js
has 683 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { declare } from "@babel/helper-plugin-utils";
import type NodePath from "@babel/traverse";
import type Scope from "@babel/traverse";
import { visitor as tdzVisitor } from "./tdz";
import values from "lodash/values";
File index.js
has 673 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as t from "@babel/types";
import { addNamed, addNamespace, isModule } from "@babel/helper-module-imports";
import annotateAsPure from "@babel/helper-annotate-as-pure";
const DEFAULT = {
Function handle
has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring. Open
handle(member) {
const { node, parent, parentPath } = member;
if (member.isOptionalMemberExpression()) {
// Transforming optional chaining requires we replace ancestors.
- 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 createClassFeaturePlugin
has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring. Open
export function createClassFeaturePlugin({
name,
feature,
loose,
manipulateOptions,
- 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 exit
has 300 lines of code (exceeds 25 allowed). Consider refactoring. Open
exit(path, state) {
const undefinedIdent = path.scope.buildUndefinedNode();
const exportIdent = path.scope.generateUid("export");
const contextIdent = state.contextIdent;
File fields.js
has 662 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { template, traverse, types as t } from "@babel/core";
import ReplaceSupers, {
environmentVisitor,
} from "@babel/helper-replace-supers";
import memberExpressionToFunctions from "@babel/helper-member-expression-to-functions";
Function processComment
has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring. Open
processComment(node: Node): void {
if (node.type === "Program" && node.body.length > 0) return;
const stack = this.state.commentStack;
- 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
} else if (
type === tt.semi ||
type === tt.comma ||
type === tt.parenL ||
type === tt.parenR ||
ExpressionParser
has 76 functions (exceeds 20 allowed). Consider refactoring. Open
export default class ExpressionParser extends LValParser {
// Forward-declaration: defined in statement.js
/*::
+parseBlock: (
allowDirectives?: boolean,
Function convertFunctionParams
has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring. Open
export default function convertFunctionParams(
path,
loose,
shouldTransformParam,
replaceRestElement,
- 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 _evaluate
has 263 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _evaluate(path, state) {
if (!state.confident) return;
const { node } = path;
Consider simplifying this complex logical expression. Open
if (
nodeType === "TSType" ||
"TSAnyKeyword" === nodeType ||
"TSBooleanKeyword" === nodeType ||
"TSBigIntKeyword" === nodeType ||
File config-chain.js
has 596 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
import path from "path";
import buildDebug from "debug";
import type { Handler } from "gensync";
Function parseExprAtom
has 239 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseExprAtom(refExpressionErrors?: ?ExpressionErrors): N.Expression {
// If a division operator appears in an expression position, the
// tokenizer got confused, and we force it to read a regexp instead.
if (this.state.type === tt.slash) this.readRegexp();