6.0 KiB
6.0 KiB
Phase 1 Audit Report - Mana-Loop Game
Overview
Audit completed on: 2024-04-24
Scope: /home/user/repos/Mana-Loop/src/ directory
Initial build status: ✅ Passing (Next.js 16.2.4 build succeeds)
1. Files Over 300 Lines (Splitting Candidates)
| File Path | Line Count | Purpose | Split Candidate |
|---|---|---|---|
src/lib/game/store.ts |
2464 | Monolithic legacy game store | YES (HIGH PRIORITY) |
src/lib/game/skill-evolution.ts |
2312 | All skill talent trees | YES (HIGH PRIORITY) |
src/lib/game/constants.ts |
1436 | Mixed game constants | YES (HIGH PRIORITY) |
src/lib/game/data/enchantment-effects.ts |
846 | Enchantment effect definitions | YES (MEDIUM PRIORITY) |
src/components/game/tabs/CraftingTab.tsx |
965 | Crafting UI (4 stages) | YES (MEDIUM PRIORITY) |
src/components/game/tabs/DebugTab.tsx |
700 | Debug/development UI | YES (LOW PRIORITY) |
src/lib/game/types.ts |
516 | Central type definitions | YES (MEDIUM PRIORITY) |
src/lib/game/computed-stats.ts |
492 | Mixed utility/stat functions | YES (MEDIUM PRIORITY) |
src/app/page.tsx |
465 | Main game page component | YES (LOW PRIORITY) |
src/components/game/GameContext.tsx |
405 | Unified store context | YES (LOW PRIORITY) |
src/lib/game/utils.ts |
372 | Mixed utility functions | YES (MEDIUM PRIORITY) |
Key Observation: Project is mid-refactor from legacy store.ts to slice-based architecture (lib/game/stores/). Priority should be completing this migration.
2. Unused Exports (207 Total)
Game Components (Never Imported)
src/components/game/ComboMeter.tsx-ComboMetersrc/components/game/GrimoireTab.tsx-GrimoireTabsrc/components/game/layout/GameFooter.tsx-GameFootersrc/components/game/layout/GameHeader.tsx-GameHeadersrc/components/game/layout/GameSidebar.tsx-GameSidebarsrc/components/game/shared/GameOverScreen.tsx-GameOverScreen
Tab Component Props (Unused Type Exports)
- All
Tabs/*TabPropstypes insrc/components/game/tabs/(12 total)
Library Files (Unused Exports)
src/lib/game/attunements.ts- 8 unused exportssrc/lib/game/constants.ts- 15+ unused exportssrc/lib/game/computed-stats.ts- 5 unused exportssrc/lib/game/effects.ts- 5 unused exportssrc/lib/game/store.ts- 7 unused exportssrc/lib/game/types.ts- 20+ unused type exportssrc/lib/game/upgrade-effects.ts- 6 unused exportssrc/lib/game/utils.ts- 2 unused exports
UI Components (shadcn/ui - Never Imported)
28 unused shadcn/ui components in src/components/ui/ (accordion, alert, calendar, chart, etc.)
3. Dead Imports (56 Total)
Top-Level Components
src/app/page.tsx: 5 dead imports (fmtDec,getDamageBreakdown,SKILL_EVOLUTION_PATHS, etc.)src/components/game/SkillsTab.tsx: 4 dead importssrc/components/game/SpellsTab.tsx: 4 dead importssrc/components/game/StatsTab.tsx: 5 dead imports
Library Files
src/lib/game/store.ts: 1 dead importsrc/lib/game/store/combatSlice.ts: 3 dead importssrc/lib/game/store/computed.ts: 4 dead importssrc/lib/game/store/skillSlice.ts: 3 dead imports
4. Unreferenced Files (57 Total)
Game Components (Never Imported)
- 7 game components including
ComboMeter.tsx,GameFooter.tsx, etc.
UI Components
- 28 unused shadcn/ui components
Library Files
- Old store architecture:
src/lib/game/store/*.ts(10 files) - Old stores:
src/lib/game/stores/*.ts(8 files) - Test files:
src/lib/game/*test.ts(4 files) src/lib/db.ts(Prisma client, may be runtime-used)
5. TODO/FIXME Comments
✅ None found in source code (only "Temp" substring matches from temporal/tempest references)
6. Unimplemented Stubs & Unused Effects
Critical Issues
EXECUTIONEReffect used but not defined (HIGH SEVERITY)- Referenced in
store.ts:1085,combatSlice.ts:102,gameStore.ts:265 - Missing from
SPECIAL_EFFECTSinupgrade-effects.ts - Will cause runtime errors
- Referenced in
Unused Effects
-
51/59
SPECIAL_EFFECTSconstants unused (Medium severity)- Only 8/59 effects are actually checked via
hasSpecial() - Examples:
FLOW_SURGE,MANA_OVERFLOW,FIRST_STRIKE, etc.
- Only 8/59 effects are actually checked via
-
5 unused enchantment
specialIdvaluesspellEcho10,fireBlade,frostBlade,lightningBlade,voidBlade- Defined in
enchantment-effects.tsbut never checked in game logic
-
~200+
specialIdvalues inskill-evolution.tsnever checked- Most
specialIdvalues added tospecialsSet but no correspondinghasSpecial()check
- Most
Empty Functions
✅ None found - no empty function stubs detected
7. Summary of Priority Actions
Phase 2 (Safe Deletions) - Recommended Deletions
- Remove 28 unused shadcn/ui components from
src/components/ui/ - Remove dead imports (56 total) across all files
- Remove old store architecture files if confirmed unused:
src/lib/game/store/*.tssrc/lib/game/stores/*.ts
- Remove unused game components if not needed:
ComboMeter.tsx,GameFooter.tsx,GameHeader.tsx, etc.
Phase 3 (Refactor Large Files) - Recommended Splits
- HIGH PRIORITY: Split
src/lib/game/store.ts(2464 lines) - complete migration to slice architecture - Split
src/lib/game/skill-evolution.ts(2312 lines) by skill category - Split
src/lib/game/constants.ts(1436 lines) into domain-specific files - Split
src/components/game/tabs/CraftingTab.tsx(965 lines) by crafting stage
Phase 4 (Implement Missing Effects) - Critical Fixes
- CRITICAL: Add
EXECUTIONER: 'executioner'toSPECIAL_EFFECTSinupgrade-effects.ts - Either implement or remove 51 unused
SPECIAL_EFFECTSconstants - Either implement or remove 5 unused enchantment
specialIdvalues - Audit ~200
specialIdvalues inskill-evolution.ts
Verification
- Initial build: ✅ Passing
- No TODO/FIXME comments found
- No empty function stubs found
- Runtime error identified: Missing
EXECUTIONEReffect definition