Showing 31 of 115 total issues
Function createVersionGroups
has 135 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createVersionGroups(
ctx: Ctx,
): Effect.Effect<never, VersionGroup.ConfigError, VersionGroup.Any[]> {
const { rcFile } = ctx.config;
const versionGroups: Effect.Effect<never, VersionGroup.ConfigError, VersionGroup.Any>[] = [
Function inspectAll
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
inspectAll(): Effect.Effect<never, never, Report.Version.Group[]> {
return Effect.all(
Object.entries(groupBy('name', this.instances)).flatMap(([name, instances]) => {
const localInstance = getLocalInstance(instances);
Function createSemverGroups
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createSemverGroups(
ctx: Ctx,
): Effect.Effect<never, SemverGroup.ConfigError, SemverGroup.Any[]> {
const { rcFile } = ctx.config;
const semverGroups: Effect.Effect<never, SemverGroup.ConfigError, SemverGroup.Any>[] = [
File effects.ts
has 310 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as Schema from '@effect/schema/Schema';
import chalk from 'chalk';
import { Data, Effect, identity, pipe } from 'effect';
import https from 'https';
import ora from 'ora';
Function inspectAll
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
inspectAll(): Effect.Effect<never, never, Report.Version.Group[]> {
return Effect.all(
Object.entries(groupBy('name', this.instances)).flatMap(([name, instances]) =>
pipe(
findSnappedToInstance(name, this.config.snapTo, instances),
Function promptForUpdates
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
promptForUpdates(outdated: Releases[]): Effect.Effect<never, PromptCancelled, void> {
return pipe(
Effect.Do,
Effect.bind('releasesByType', () => groupByReleaseType(outdated)),
// Create choices to ask if they want major, minor, patch etc
Function inspectAll
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
inspectAll(): Effect.Effect<never, never, Report.Version.Group[]> {
return Effect.all(
Object.entries(groupBy('name', this.instances)).flatMap(([name, instances]) =>
pipe(
instances,
Function getInstances
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getInstances(
ctx: Ctx,
io: Io,
errorHandlers: ErrorHandlers,
): Effect.Effect<never, never, Instances> {
Function promptForReleaseType
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function promptForReleaseType(
releaseType: ReleaseType,
doState: { releasesByType: ReleasesByType; releaseTypeAnswers: string[] },
): Effect.Effect<never, PromptCancelled, Releases[]> {
const { releasesByType, releaseTypeAnswers } = doState;
Function fetchLatestVersions
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
fetchLatestVersions(
instance: Instance,
): Effect.Effect<never, HttpError | NpmRegistryError, Releases> {
return pipe(
fetchJson(`https://registry.npmjs.org/${instance.name}`),
Function getInstances
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
getInstances(enabledTypes: Strategy.Any[]): Effect.Effect<never, never, Instance[]> {
if (!this._instances) {
return pipe(
Effect.all(
enabledTypes.map((strategy) =>
Function showHelpOnError
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function showHelpOnError(program: Command) {
program.showHelpAfterError(chalk`
1. The following options were replaced in syncpack@9.0.0:
{red
-p, --prod include dependencies
Function fetchJson
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function fetchJson(url: string): Effect.Effect<never, HttpError | NpmRegistryError, unknown> {
return pipe(
Effect.async<never, HttpError, string>((resume) => {
// setTimeout(
// () => {
Function withLogger
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function withLogger(program: Effect.Effect<never, never, unknown>) {
const logger = Logger.make(({ logLevel, message }) => {
if (logLevel === LogLevel.Info) {
globalThis.console.info(message);
} else if (logLevel === LogLevel.Debug) {
- 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 compareSemver
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function compareSemver(a: string, b: string): -1 | 0 | 1 {
if (a.startsWith('workspace:')) return LT;
if (b.startsWith('workspace:')) return GT;
if (a === b) return EQ;
if (a === '*') return GT;
- 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 getChild
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function getChild(parent: unknown, prop: string): unknown | Either.Either<Error, never> {
// quit if any ancestor was already not found
if (Either.isEither(parent) && Either.isLeft(parent)) return parent;
// ensure we have a plain value and not an Ok
const 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
Function formatRepositoryUrl
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function formatRepositoryUrl(input: string | undefined): string | undefined {
if (!input) return undefined;
const extractedUrl = input.match(/https?:\/\/[^\s]+/)?.[0];
if (extractedUrl) {
- 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 `https://${withoutAffix}`;
Avoid too many return
statements within this function. Open
return Effect.succeed(new VersionsByNameStrategy(name, path));
Avoid too many return
statements within this function. Open
return createError(config, ERR_STRATEGY);