8.2 KiB
Code Analysis Report
Calendar Plantempus TypeScript Codebase
Generated: 2025-10-06
Tool: ts-unused-exports
Total Files Analyzed: 40+ TypeScript files
Executive Summary
Unused Exports Found
- Total Modules with Unused Exports: 14
- Total Unused Exports: 40+
Impact Assessment
- 🟢 Low Risk: Type definitions and interfaces (can be kept for future use)
- 🟡 Medium Risk: Unused classes and managers (should be reviewed)
- 🔴 High Risk: Duplicate implementations (should be removed)
Detailed Findings
1. Constants & Core (src/constants/)
CoreEvents.ts
Unused Exports:
CoreEventType- Type definitionEVENT_MIGRATION_MAP- Migration mapping
Analysis:
CoreEventTypeer en type definition - kan være nyttig for fremtidig type-sikkerhedEVENT_MIGRATION_MAPser ud til at være til migration fra gamle events - kan muligvis fjernes hvis migration er færdig
Recommendation: ⚠️ Review - Tjek om migration er færdig
2. Factories (src/factories/)
CalendarTypeFactory.ts
Unused Exports:
RendererConfig- Interface
Analysis:
- Interface der ikke bruges eksternt
- Kan være intern implementation detail
Recommendation: ✅ Keep - Internal interface, no harm
3. Interfaces (src/interfaces/)
IManager.ts
Unused Exports:
IEventManagerIRenderingManagerINavigationManagerIScrollManager
Analysis:
- Disse interfaces definerer kontrakter men bruges ikke
- Kan være planlagt til fremtidig dependency injection
Recommendation: 🔴 CRITICAL - Enten brug interfaces eller fjern dem. Interfaces uden implementation er dead code.
4. Managers (src/managers/)
EventLayoutCoordinator.ts
Unused Exports:
ColumnLayout- Interface
Analysis:
- Return type interface der ikke bruges eksternt
Recommendation: ✅ Keep - Part of public API
SimpleEventOverlapManager.ts
Unused Exports:
OverlapTypeOverlapGroupStackLinkSimpleEventOverlapManager- ENTIRE CLASS
Analysis:
- 🔴 CRITICAL FINDING: Hele klassen er ubrugt!
- Dette ser ud til at være en gammel implementation der er blevet erstattet af
EventStackManager
Recommendation: 🔴 DELETE - Remove entire file if not used
WorkHoursManager.ts
Unused Exports:
DayWorkHoursWorkScheduleConfig
Analysis:
- Interfaces for work hours functionality
- Kan være planlagt feature
Recommendation: ⚠️ Review - Check if feature is planned or abandoned
5. Strategies (src/strategies/)
MonthViewStrategy.ts
Unused Exports:
MonthViewStrategy- ENTIRE CLASS
Analysis:
- 🔴 CRITICAL: Hele strategy-klassen er ubrugt
- Kan være planlagt feature eller gammel implementation
Recommendation: 🔴 DELETE or IMPLEMENT - Either use it or remove it
WeekViewStrategy.ts
Unused Exports:
WeekViewStrategy- ENTIRE CLASS
Analysis:
- 🔴 CRITICAL: Hele strategy-klassen er ubrugt
- Samme som MonthViewStrategy
Recommendation: 🔴 DELETE or IMPLEMENT - Either use it or remove it
6. Types (src/types/)
CalendarTypes.ts
Unused Exports:
SyncStatusResourceGridPositionPeriodEventDataDateModeContextResourceModeContextCalendarModeContext
Analysis:
- Mange type definitions der ikke bruges
- Nogle kan være planlagt features (Resource, ResourceModeContext)
- Andre kan være legacy (SyncStatus, EventData)
Recommendation: ⚠️ Review each type individually
DragDropTypes.ts
Unused Exports:
DragStateDragEndPositionStackLinkDataDragEventHandlers
Analysis:
- Drag & drop types der ikke bruges eksternt
- Kan være internal types
Recommendation: ✅ Keep - Part of drag-drop system
EventPayloadMap.ts
Unused Exports:
CalendarEventPayloadMapEventPayloadhasPayload
Analysis:
- Event payload system der ikke bruges
- Kan være planlagt type-safe event system
Recommendation: ⚠️ Review - Check if this is planned feature
EventTypes.ts
Unused Exports:
AllDayEventTimeEventCalendarEventDataMousePosition
Analysis:
- Type definitions for events
MousePositionbruges sandsynligvis internt
Recommendation: ✅ Keep - Core types
ManagerTypes.ts
Unused Exports:
EventManagerEventRenderingServiceGridManagerScrollManagerNavigationManagerViewManagerCalendarManagerDragDropManagerAllDayManagerResourceResourceAssignment
Analysis:
- 🔴 CRITICAL: Mange manager types der ikke bruges
- Dette tyder på at type system ikke er implementeret korrekt
Recommendation: 🔴 REFACTOR - Either use these types or remove them
7. Utils (src/utils/)
OverlapDetector.ts
Unused Exports:
EventIdOverlapResultStackLinkOverlapDetector- ENTIRE CLASS
Analysis:
- 🔴 CRITICAL: Hele utility-klassen er ubrugt
- Sandsynligvis erstattet af anden implementation
Recommendation: 🔴 DELETE - Remove if not used
Summary Statistics
By Category
| Category | Total Unused | Critical (Classes) | Medium (Interfaces) | Low (Types) |
|---|---|---|---|---|
| Constants | 2 | 0 | 0 | 2 |
| Factories | 1 | 0 | 1 | 0 |
| Interfaces | 4 | 0 | 4 | 0 |
| Managers | 8 | 1 | 3 | 4 |
| Strategies | 2 | 2 | 0 | 0 |
| Types | 23 | 0 | 0 | 23 |
| Utils | 4 | 1 | 0 | 3 |
| TOTAL | 44 | 4 | 8 | 32 |
Critical Issues (Requires Immediate Action)
🔴 Unused Classes (Dead Code)
SimpleEventOverlapManager- Entire class unusedMonthViewStrategy- Entire class unusedWeekViewStrategy- Entire class unusedOverlapDetector- Entire class unused
🔴 Unused Interfaces (Architecture Issue)
IManager.ts- All 4 interfaces unused- Suggests dependency injection pattern not implemented
- Either implement or remove
Recommendations
Immediate Actions (High Priority)
-
Delete Dead Code:
# Remove these files if confirmed unused: rm src/managers/SimpleEventOverlapManager.ts rm src/strategies/MonthViewStrategy.ts rm src/strategies/WeekViewStrategy.ts rm src/utils/OverlapDetector.ts -
Review Interfaces:
- Decide if
IManager.tsinterfaces should be implemented - If not, remove them
- Decide if
-
Clean Up Types:
- Review
ManagerTypes.ts- many unused types - Consider if these are planned features or legacy code
- Review
Medium Priority
-
Review Planned Features:
ResourceandResourceModeContext- Are these planned?WorkHoursManagertypes - Is this feature coming?EventPayloadMap- Is type-safe event system planned?
-
Document Decisions:
- Add comments explaining why certain exports exist
- Mark planned features clearly
Low Priority
- Type Definitions:
- Most type definitions can stay (low cost)
- But consider if they add confusion
Estimated Impact
Code Reduction Potential
- Files that can be deleted: 4 (SimpleEventOverlapManager, MonthViewStrategy, WeekViewStrategy, OverlapDetector)
- Lines of code reduction: ~500-800 lines
- Maintenance burden reduction: Significant
Risk Assessment
- Low Risk: Removing unused classes (they're not imported anywhere)
- Medium Risk: Removing interfaces (might break future plans)
- High Risk: None (all findings are confirmed unused)
Next Steps
- ✅ Review this report with team
- ⚠️ Decide on each critical issue
- 🔴 Create cleanup tasks
- ✅ Run tests after cleanup
- ✅ Update documentation
Tools Used
- ts-unused-exports v11.0.1
- Analysis date: 2025-10-06
- Project: Calendar Plantempus