Surfaced by desloppify scan. The boilerplate_duplication detector found 9 repeated code blocks (7-15 line windows).
Findings
src/db/queries/ (4 findings — auth-guard / start-timer boilerplate)
| Files |
src/db/queries/api.mjs:17 + src/features/archives/reseedSeason.mjs:34 (7 lines) |
src/db/queries/api.mjs:59 + src/features/archives/reseedSeason.mjs:34 (7 lines) |
src/db/queries/account.mjs:57 + src/db/queries/api.mjs:59 (11 lines) |
src/db/queries/account.mjs:13 + src/db/queries/api.mjs:17 (8 lines) |
Suggested helper: a shared requireAuth() / withTiming() wrapper for query-layer functions. See CLAUDE.md § Error Handling — the project already has tryCatch; an auth-guard companion would slot in cleanly.
src/db/queries/admin.mjs (1 finding)
| Files |
src/db/queries/admin.mjs:183 + src/db/queries/api.mjs:36 (15 lines) |
Validators (1 finding)
| Files |
src/validators/isValidSeason.mjs:43 + src/validators/isValidStatus.mjs:25 (11 lines) |
Upsert helpers (1 finding)
| Files |
src/db/queries/upsertStatistic.mjs:25 + src/db/queries/upsertStatus.mjs:19 (8 lines) |
Timeline components (1 finding)
| Files |
src/features/timeline/CascadeLog.jsx:30 + src/features/timeline/EventLog.jsx:47 (8 lines) |
Galaxy event cards (1 finding)
| Files |
src/features/galaxy/DefeatedCard.jsx:47 + src/features/galaxy/EventCard.jsx:191 (12 lines) |
Action
- DB query boilerplate is the highest-leverage cluster (5 findings, all auth-guard / timing pattern). Extract a single helper.
- Validator + upsert duplication is small but mechanical — share a tiny helper.
- Component duplication (CascadeLog/EventLog, DefeatedCard/EventCard) — judgment call: pull out a shared sub-component if the shape is genuinely the same.
Detector: boilerplate_duplication · Tier T3
🤖 Filed by /desloppify
Surfaced by
desloppify scan. Theboilerplate_duplicationdetector found 9 repeated code blocks (7-15 line windows).Findings
src/db/queries/(4 findings — auth-guard / start-timer boilerplate)src/db/queries/api.mjs:17+src/features/archives/reseedSeason.mjs:34(7 lines)src/db/queries/api.mjs:59+src/features/archives/reseedSeason.mjs:34(7 lines)src/db/queries/account.mjs:57+src/db/queries/api.mjs:59(11 lines)src/db/queries/account.mjs:13+src/db/queries/api.mjs:17(8 lines)Suggested helper: a shared
requireAuth()/withTiming()wrapper for query-layer functions. See CLAUDE.md § Error Handling — the project already hastryCatch; anauth-guardcompanion would slot in cleanly.src/db/queries/admin.mjs(1 finding)src/db/queries/admin.mjs:183+src/db/queries/api.mjs:36(15 lines)Validators (1 finding)
src/validators/isValidSeason.mjs:43+src/validators/isValidStatus.mjs:25(11 lines)Upsert helpers (1 finding)
src/db/queries/upsertStatistic.mjs:25+src/db/queries/upsertStatus.mjs:19(8 lines)Timeline components (1 finding)
src/features/timeline/CascadeLog.jsx:30+src/features/timeline/EventLog.jsx:47(8 lines)Galaxy event cards (1 finding)
src/features/galaxy/DefeatedCard.jsx:47+src/features/galaxy/EventCard.jsx:191(12 lines)Action
Detector:
boilerplate_duplication· Tier T3🤖 Filed by
/desloppify