Skip to content

fix(health): suppress primitive obsession in tiny modules#313

Merged
RaghavChamadiya merged 1 commit into
mainfrom
feat/health-biomarker-gate-fixes
May 29, 2026
Merged

fix(health): suppress primitive obsession in tiny modules#313
RaghavChamadiya merged 1 commit into
mainfrom
feat/health-biomarker-gate-fixes

Conversation

@RaghavChamadiya
Copy link
Copy Markdown
Member

A wide parameter list in a very small module (under 60 non-blank lines) is almost always an idiomatic config/builder/forwarder entry point, not a value object waiting to be extracted. Firing the primitive_obsession smell there flags clean small utility files and adds noise without predictive value.

This gates the detector on a minimal file size so the smell only fires where it carries signal.

Scope

  • Scoring weights, categories and caps are unchanged; larger modules and the per-function parameter logic behave exactly as before.
  • The detector simply returns no findings in modules below the size floor.

Validation

  • A defect-prediction analysis across a 13-repo, 5-language corpus showed primitive_obsession firing on small files is anti-predictive (it flags clean small utility files), inverting discrimination on the small-file size band. Suppressing it there improves that band and leaves overall discrimination and cost-effectiveness unchanged — a precision/noise fix with no regression.
  • Added a regression test for tiny-file suppression; existing cases updated to substantial modules. Full health suite green (212 passed); lint + format clean; scoring snapshot unchanged.

A wide parameter list in a very small module (under 60 non-blank lines) is
almost always an idiomatic config/builder/forwarder entry point, not a value
object waiting to be extracted. Firing the primitive_obsession smell there
flags clean small utility files and adds noise without predictive value.

Gate the detector on a minimal file size so the smell only fires where it
carries signal. Scoring weights, categories and caps are unchanged; larger
modules and the per-function parameter logic behave exactly as before. Adds a
regression test for the tiny-file suppression and updates the existing cases to
substantial modules.
@RaghavChamadiya RaghavChamadiya requested a review from swati510 as a code owner May 29, 2026 19:40
@RaghavChamadiya RaghavChamadiya merged commit 7d8ccb1 into main May 29, 2026
5 checks passed
@RaghavChamadiya RaghavChamadiya deleted the feat/health-biomarker-gate-fixes branch May 29, 2026 19:41
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.

2 participants