Skip to content

fix: exclude test files from coverage/coupling metrics#12

Merged
bntvllnt merged 2 commits intomainfrom
fix/metrics-test-files
Mar 11, 2026
Merged

fix: exclude test files from coverage/coupling metrics#12
bntvllnt merged 2 commits intomainfrom
fix/metrics-test-files

Conversation

@bntvllnt
Copy link
Owner

Summary

Fixes #7

  • Added isTestFile detection to FileMetrics (matches .test.ts, .spec.tsx, __tests__/, etc.)
  • Filtered test files from coverage and coupling hotspot results
  • Adjusted coupling formula: fanOut / (max(fanIn, 1) + fanOut) — leaf consumers no longer auto-rank highest
  • Updated existing tests for new coupling formula

Test plan

  • Regression tests for all ACs (19 new tests)
  • All existing tests pass (205 total)
  • Quality gates: lint, typecheck, build, test

@bntvllnt bntvllnt self-assigned this Mar 11, 2026
- Added `isTestFile` detection to FileMetrics (matches `.test.ts`, `.spec.tsx`, `__tests__/`, etc.)
- Filtered test files from coverage and coupling hotspot results
- Adjusted coupling formula: `fanOut / (max(fanIn, 1) + fanOut)` — leaf consumers no longer auto-rank highest
- Updated existing tests for new coupling formula
- Added `.spec.ts` fixture file for spec-pattern test coverage
- Updated docs/metrics.md and docs/data-model.md
@bntvllnt bntvllnt force-pushed the fix/metrics-test-files branch from 347c093 to 1bb2deb Compare March 11, 2026 13:47
@bntvllnt bntvllnt merged commit b6546d3 into main Mar 11, 2026
1 check passed
@bntvllnt bntvllnt deleted the fix/metrics-test-files branch March 11, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: coverage and coupling metrics miscount test files

1 participant