[OPTIMIZATION] Dead Code & Redundancy - Duplicate Helpers & Unused Exports #67

Closed
opened 2026-06-06 20:50:06 +00:00 by Mark · 0 comments
Owner

High Issues (1)

  1. Duplicate helper functions across 5 files (~500 lines)
    • getInitials, getAvatarColorStart, getAvatarColorEnd, getClosenessLabel, getAvatarGradient
    • Locations: utils.ts (exports), PersonDetail.tsx, People.tsx, PersonDetail.js, People.js
    • Fix: Remove local duplicates, import from @/lib/utils

Medium Issues (2)

  1. Duplicate extractKeywords implementation

    • metrics-engine.ts:731 (35 stopwords) vs utils.ts:556 (20 stopwords)
    • Fix: Consolidate to utils.ts, import in metrics-engine.ts
  2. Unused exports in production bundle (~300 lines)

    • utils.ts: exportToJson, importFromJson, parseCsv, generateId, extractKeywords, generateObservationSuggestions, getClosenessLabel, getInteractionMeta (never used)
    • metrics-engine.ts: 6 functions only in tests
    • streak-engine.ts: computeAllStreaks only in tests
    • Fix: Move test-only functions to .test.ts files, remove getInteractionMeta

Low Issues (1)

  1. Duplicate .js / .tsx page files (10+ files)
    • PersonDetail.tsx + .js, People.tsx + .js, Settings.tsx + .js, LogInteraction.tsx + .js, PersonCard.tsx + .js, Avatar.tsx + .js, UI components
    • Fix: Delete .js versions (appear to be older duplicates)
    • Impact: ~2000+ lines removed
## High Issues (1) 1. **Duplicate helper functions** across 5 files (~500 lines) - `getInitials`, `getAvatarColorStart`, `getAvatarColorEnd`, `getClosenessLabel`, `getAvatarGradient` - Locations: `utils.ts` (exports), `PersonDetail.tsx`, `People.tsx`, `PersonDetail.js`, `People.js` - Fix: Remove local duplicates, import from `@/lib/utils` ## Medium Issues (2) 2. **Duplicate `extractKeywords` implementation** - `metrics-engine.ts:731` (35 stopwords) vs `utils.ts:556` (20 stopwords) - Fix: Consolidate to utils.ts, import in metrics-engine.ts 3. **Unused exports in production bundle** (~300 lines) - `utils.ts`: `exportToJson`, `importFromJson`, `parseCsv`, `generateId`, `extractKeywords`, `generateObservationSuggestions`, `getClosenessLabel`, `getInteractionMeta` (never used) - `metrics-engine.ts`: 6 functions only in tests - `streak-engine.ts`: `computeAllStreaks` only in tests - Fix: Move test-only functions to `.test.ts` files, remove `getInteractionMeta` ## Low Issues (1) 4. **Duplicate .js / .tsx page files** (10+ files) - `PersonDetail.tsx` + `.js`, `People.tsx` + `.js`, `Settings.tsx` + `.js`, `LogInteraction.tsx` + `.js`, `PersonCard.tsx` + `.js`, `Avatar.tsx` + `.js`, UI components - Fix: Delete `.js` versions (appear to be older duplicates) - Impact: ~2000+ lines removed
Mark 2026-06-13 19:10:24 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/kimi_agent_kin_app_sync#67
No description provided.