Showing 13 of 27 total issues
Function execute
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
) => Promise<unknown> = async (commands, packages, options) => {
await concurrently(
[commands].flat().flatMap((command) =>
[packages].flat().flatMap((pkg) => ({
command: lodash.isString(command)
- 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 installData
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const installData = async (
data: InstallData,
cwd: string,
uninstall: boolean,
) =>
- 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 diffJson
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const diffJson = (json1: any, json2: any): any =>
Object.keys(json1).reduce((result, key) => {
if (lodash.isEqual(json1[key], json2[key])) {
return result
}
- 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 getTopo
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
) => Promise<ExtraTopoContext> = async (options, preset) => {
const context = await topo(options)
const packages = Object.fromEntries(
await Promise.all(
Object.entries(context.packages).map<
Function createCommandInstall
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const createCommandInstall = (
install: Install,
modules: string[] = [],
) => [
createCommand('install', 'install').action(async (options, context) => {
- 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 run
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const run = async (
pkg: string | ExtraPackageEntry,
modules: string[],
command: string,
preset: string | undefined,
- 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 data
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
data: (pkg, topo) => [
{
[tsCjs]: {
...(pkg.leaf || pkg.unit
? {
- 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 testTypes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
) => TestType[] = (unit, it, e2e) => {
return (
unit || it || e2e
? [
...(unit ? ['unit'] : []),
- 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 npx
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const npx: (module: string, cwd: string) => string = (module, cwd) => {
const { devDependencies = {} } = getPackageJson()
const at = module.indexOf('@', module.startsWith('@') ? 1 : 0)
const name = at === -1 ? module : module.slice(0, at)
const version =
- 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 data
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
data: (pkg, topo) => [
pkg.leaf || pkg.unit
? {
[swcCjs]: {
$schema: 'https://json.schemastore.org/swcrc',
- 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 cmd
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
) => string = (bin, args = {}, env = {}) =>
[
...Object.entries(env)
.filter(([key, value]) => !lodash.isNil(key) && !lodash.isNil(value))
.flatMap(([key, value]) => `${key}=${value}`),
- 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
Avoid too many return
statements within this function. Open
return { ...result, [key]: d }
Avoid too many return
statements within this function. Open
return { ...result, [key]: json1[key] }