Skip to content

refactor(cli): split normalizeSession to reduce cyclomatic complexity #1282

@ericksoa

Description

@ericksoa

Issue

normalizeSession in src/lib/onboard-session.ts has an eslint complexity waiver (eslint-disable-next-line complexity). It handles schema coercion, redaction, defaults, metadata normalization, and step normalization in one function.

Fix

Extract helpers like coerceSessionFields, normalizeMetadata, and normalizeSteps so the waiver can be removed and the function stays under the complexity limit (target: 15).

Found by

CodeRabbit review on #1272. Pre-existing from original JS.

Metadata

Metadata

Assignees

Labels

area: cliCommand line interface, flags, terminal UX, or outputrefactorPR restructures code without intended behavior change

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions