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

NemoClaw CLIUse this label to identify issues with the NemoClaw command-line interface (CLI).enhancement: refactoring

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions