Showing 1,251 of 1,982 total issues
Function exit
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
exit(path, { requireId }) {
if (!isModule(path)) {
if (requireId) {
injectWrapper(
path,
Function exit
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
exit(path, state) {
const { node, parent, scope } = path;
let hasComputed = false;
for (const prop of (node.properties: Array<Object>)) {
hasComputed = prop.computed === true;
Function parseForStatement
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
parseForStatement(node: N.Node): N.ForLike {
this.next();
this.state.labels.push(loopLabel);
let awaitAt = -1;
- 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 a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
exit(path) {
const {
scope,
seen,
imported,
- 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 19 (exceeds 5 allowed). Consider refactoring. Open
export default function ({ node, parent, scope, id }, localBinding = false) {
// has an `id` so we don't need to infer one
if (node.id) return;
if (
- 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 createDescriptor
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export function createDescriptor(
pair: PluginItem,
dirname: string,
{
type,
- 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 assertPluginItem
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function assertPluginItem(loc: GeneralPath, value: mixed): PluginItem {
if (Array.isArray(value)) {
if (value.length === 0) {
throw new Error(`${msg(loc)} must include an 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 registerBinding
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
registerBinding(kind: string, path: NodePath, bindingPath = path) {
if (!kind) throw new ReferenceError("no `kind`");
if (path.isVariableDeclaration()) {
const declarators: Array<NodePath> = path.get("declarations");
- 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 getDeepestCommonAncestorFrom
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export function getDeepestCommonAncestorFrom(
paths: Array<NodePath>,
filter?: Function,
): NodePath {
if (!paths.length) {
- 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 plugins.js
has 274 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 exit
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
exit(path, state) {
if (!isModule(path)) return;
// Rename the bindings auto-injected into the scope so there is no
// risk of conflict between the bindings.
Function validatePlugins
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function validatePlugins(plugins: PluginList) {
if (hasPlugin(plugins, "decorators")) {
if (hasPlugin(plugins, "decorators-legacy")) {
throw new Error(
"Cannot use the decorators and decorators-legacy plugin together",
Function explode
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function explode(visitor) {
if (visitor._exploded) return visitor;
visitor._exploded = true;
// normalise pipes
Function flowParseObjectTypeProperty
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
flowParseObjectTypeProperty(
node: N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty,
isStatic: boolean,
protoStart: ?number,
variance: ?N.FlowVariance,
Function toAssignable
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
toAssignable(node: Node): Node {
let parenthesized = undefined;
if (node.type === "ParenthesizedExpression" || node.extra?.parenthesized) {
parenthesized = unwrapParenthesizedExpression(node);
if (
Function isStatement
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function isStatement(node: ?Object, opts?: Object): boolean {
if (!node) return false;
const nodeType = node.type;
if (
Function cloneNode
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function cloneNode<T: Object>(
node: T,
deep: boolean = true,
withoutLoc: boolean = false,
): T {
Function flowParseDeclareModule
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
flowParseDeclareModule(node: N.FlowDeclareModule): N.FlowDeclareModule {
this.scope.enter(SCOPE_OTHER);
if (this.match(tt.string)) {
node.id = this.parseExprAtom();
File utils.js
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
import is from "../validators/is";
import { validateField, validateChild } from "../validators/validate";
export const VISITOR_KEYS: { [string]: Array<string> } = {};
Function VariableDeclaration
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
VariableDeclaration(path) {
const { node, scope, parent } = path;
if (t.isForXStatement(parent)) return;
if (!parent || !path.container) return; // i don't know why this is necessary - TODO
if (!variableDeclarationHasPattern(node)) return;