Showing 1,251 of 1,982 total issues
Function loadPrivatePartialConfig
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function* loadPrivatePartialConfig(
inputOpts: mixed,
): Handler<PrivPartialConfig | null> {
if (
inputOpts != null &&
Function validate
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function validate(opts: mixed): TemplateOpts {
if (opts != null && typeof opts !== "object") {
throw new Error("Unknown template options.");
}
Function mergeSourceMap
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function mergeSourceMap(
inputMap: SourceMap,
map: SourceMap,
): SourceMap {
const input = buildMappingData(inputMap);
Function _guessExecutionStatusRelativeTo
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function _guessExecutionStatusRelativeTo(
target: NodePath,
): RelativeExecutionStatus {
// check if the two paths are in different functions, we can't track execution of these
const funcParent = {
Referencer
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Referencer extends OriginalReferencer {
// inherits.
visitPattern(node, options, callback) {
if (!node) {
return;
Function tsParseNonArrayType
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
tsParseNonArrayType(): N.TsType {
switch (this.state.type) {
case tt.name:
case tt._void:
case tt._null: {
Function parseObjectMember
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
parseObjectMember(
isPattern: boolean,
refExpressionErrors?: ?ExpressionErrors,
): N.ObjectMember | N.SpreadElement | N.RestElement {
let decorators = [];
Function enter
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
enter(path) {
if (!injectCoreJS) return;
if (!path.isReferenced()) return;
// skip transforming `delete something.includes`
if (path.parentPath.isUnaryExpression({ operator: "delete" })) return;
Function CallExpression
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
CallExpression(path) {
if (!injectCoreJS) return;
const { node } = path;
const { callee } = node;
File xhtml.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// @flow
const entities: { [name: string]: string } = {
quot: "\u0022",
amp: "&",
File import-injector.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import assert from "assert";
import * as t from "@babel/types";
import ImportBuilder from "./import-builder";
import isModule from "./is-module";
Function Class
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Class(path) {
const { node } = path;
let comments = [];
if (node.typeParameters) {
const typeParameters = path.get("typeParameters");
Function plainFunction
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function plainFunction(path: NodePath, callId: Object) {
const node = path.node;
const isDeclaration = path.isFunctionDeclaration();
const functionId = node.id;
const wrapper = isDeclaration
Function flowParseDeclareExportDeclaration
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
flowParseDeclareExportDeclaration(
node: N.FlowDeclareExportDeclaration,
insideModule: ?boolean,
): N.FlowDeclareExportDeclaration {
this.expect(tt._export);
Function enableFeature
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 }
Function isPure
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
isPure(node, constantsOnly?: boolean) {
if (t.isIdentifier(node)) {
const binding = this.getBinding(node.name);
if (!binding) return false;
if (constantsOnly) return binding.constant;
Function readConfigJS
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const readConfigJS = makeStrongCache(function* readConfigJS(
filepath: string,
cache: CacheConfigurator<{
envName: string,
caller: CallerMetadata | void,
Function walk
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function walk(filenames: Array<string>): Promise<void> {
const _filenames = [];
filenames.forEach(function (filename) {
if (!fs.existsSync(filename)) return;
Function assertOptionalChainStart
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
export function assertOptionalChainStart(): Validator {
function validate(node) {
let current = node;
while (node) {
const { type } = current;
- 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 removeTypeDuplicates
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
export default function removeTypeDuplicates(
nodes: Array<Object>,
): Array<Object> {
const generics = {};
const bases = {};
- 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"