Showing 15 of 115 total issues
Function defineOnHTMLElement
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function defineOnHTMLElement<T extends HTMLElement & {
controller: ApolloController<unknown, unknown>;
requestUpdate?(name?: string, old?: unknown): void;
}>(
proto: T,
- 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 component.ts
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type { ComponentOptions, Operation } from './options';
import Case from 'case';
import { promisify } from 'util';
File prompt.ts
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type { BaseOptions, AppOptions, ComponentOptions } from './options';
import { app } from './app.js';
import { component } from './component.js';
Function githubTag
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function githubTag() {
return {
parse(tagToken) {
this.repo = tagToken.args;
},
Function render
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
async render() {
const url = new URL(`/repos/${this.repo}`, 'https://api.github.com/');
const headers = { 'Accept': 'application/vnd.github.v3+json' };
const repo = await fetch(url.toString(), { headers }).then(x => x.json());
return `
Function resolveLocalFilesFromTypeScriptSources
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function resolveLocalFilesFromTypeScriptSources({ rootDir }) {
return {
name: 'resolve-local-monorepo-packages-from-ts-sources',
async transformImport({ source, context }) {
const isNodeModule = source.match(/node_modules/) || context.path.match(/node_modules/);
- 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 promptComponent
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function promptComponent(
options?: PromptOptions<ComponentOptions>
): Promise<ComponentOptions> {
return {
...options,
Function typeCheck
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
typeCheck() {
/* eslint-disable max-len, func-call-spacing, no-multi-spaces */
// ApolloElementInterface
assertType<ApolloClient<NormalizedCacheObject>> (this.client);
Function typeCheck
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
typeCheck() {
/* eslint-disable max-len, func-call-spacing, no-multi-spaces */
// ApolloElementInterface
assertType<ApolloClient<NormalizedCacheObject>> (this.client!);
Function promptApp
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function promptApp(options: PromptOptions<AppOptions>): Promise<AppOptions> {
return {
...options,
...await inquirer.prompt([{
type: 'input',
Function eleventy
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
eleventy(eleventyConfig) {
eleventyConfig
.addPassthroughCopy('decks/azconf-dev-2021/**/*.{js,png,svg,jpg,webp,woff,woff2}');
eleventyConfig.addFilter('formatDate', date =>
date instanceof Date ? date.toDateString() : date);
Function initFiles
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function initFiles(options: AppOptions) {
if (!options.silent)
console.log(`\n${cyan('Scaffolding App Files')}...\n`);
const templatePath = path.resolve(__dirname, 'template', 'app');
await ncp(templatePath, options.directory);
Function tryToResolve
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function tryToResolve(source, context, rootDir) {
let resolved = '';
try {
const require = createRequire(rootDir);
- 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 codegen
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export async function codegen(options: BaseOptions): Promise<ExecaReturnValue|void> {
if (!options.codegen) return;
if (!options.silent)
console.log(`\n${cyan('Generating types from schema')}...\n`);
try {
- 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 execStart
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async function execStart(options: AppOptions) {
if (!options.start) {
if (!options.silent) console.log('Launch aborted\n');
} else {
if (!options.silent) console.log('🚀 Prepare for Takeoff...\n');
- 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"