Skip to content

Code Health: raise the in-process testing support to 9.5 #289

Closed

Description

@woksin

Three files in the in-process testing support (@cratis/chronicle/testing) score lowest in CodeScene across the repository:

file score main findings
Source/testing/projections/ProjectionCapabilities.ts 2.85 validate (cc 63) and checkMapping (cc 56) are complex and large; several 7-argument functions
Source/testing/InProcessEventSequence.ts 3.44 appendMany (cc 74, 103 lines) and append (cc 40); bumpy road, complex conditionals
Source/testing/projections/ProjectionValueConverter.ts 5.52 convert (cc 59), nesting depth 4

Raise each to at least 9.5 with behavior-preserving extractions: characterization specs first for any path the existing specs do not pin, then split the large methods into named steps. No change to exported types, function signatures or messages.

Acceptance criteria

  • All three files score at least 9.5 in CodeScene; new files score 10.
  • Specs pin the rejection and conversion paths that are refactored.
  • yarn compile, lint and the full spec suite pass.

Status

State: Done — Merged #290; closed; next-major remainder #291
Branch: fix/4906-repair-timing-options (#290)
Scope: Branch chore/code-health-testing: ProjectionCapabilities, InProcessEventSequence, ProjectionValueConverter to >= 9.5, TS light checks.
Plan: Characterization specs for unpinned rejection/conversion paths, then behavior-preserving extract-and-name refactors of the three large methods; no exported surface or message changes. Gate: yarn compile, lint, full spec suite (light checks).
Delivered: Nothing yet.
Remaining: To be confirmed.
Follow-ups: None.

Activity

  1. self-assigned this
    on Nov 11, 2026
  2. woksin commented on Nov 11, 2026

    @woksin
    ContributorAuthor

    Delivered in #290: ProjectionCapabilities 2.85 -> 10, ProjectionValueConverter 5.52 -> 10, InProcessEventSequence 3.44 -> 9.09, new helper modules 10. The remaining InProcessEventSequence findings need public signature changes and are tracked for the next major in #291.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions