Skip to content

🧼 Clean up unused properties (safe assignments) #229

@DrunkOnJava

Description

@DrunkOnJava

Problem

Multiple properties are assigned values but never read, indicating either incomplete implementation or unnecessary assignments.

⚠️ SAFE CLEANUP ONLY - PRESERVE FUNCTIONALITY

This is about safe property cleanup, not feature removal:

  • Keep all properties that may be used in future development
  • Only clean up truly unnecessary assignments
  • Mark intentionally unused properties appropriately

Categories of Unused Properties

View Model State Properties

Analytics Module:

  • CategoryBreakdownView.swift:270 - category assigned but never read
  • TrendsView.swift:167 - period assigned but never read

Potential Action: These may be preparation for future features - mark with // TODO: Use in feature X

Service Properties in ViewModels

Receipt Processing:

  • ReceiptPreviewViewModel.swift:21 - documentStorage assigned but never used
  • May indicate incomplete document management feature

Container Properties

AppContainer.swift - Multiple service assignments:

  • Properties that are assigned during dependency injection but not directly accessed
  • May be accessed through protocols or dependency injection

Safe Cleanup Strategy

Option 1: Mark as Intentionally Unused

// For properties that will be used in future development
private let documentStorage: DocumentStorageProtocol // TODO: Implement document management

Option 2: Add Usage Comment

// For dependency injection properties
private let securityService: SecurityServiceProtocol // Used via DI container

Option 3: Remove if Truly Unnecessary

Only if property serves no current or planned purpose

Investigation Tasks

  • Review each unused property for planned usage
  • Check git history to understand property purpose
  • Consult architecture docs for dependency injection patterns
  • Identify future feature placeholders vs unnecessary code

Cleanup Tasks (After Investigation)

  • Add TODO comments for future feature properties
  • Add usage comments for DI container properties
  • Remove only truly unnecessary assignments
  • Update property documentation where needed

Safety Checks

  • Verify no properties are accessed via reflection or strings
  • Check that DI container doesn't require assigned properties
  • Ensure no future features depend on these properties
  • Test that removal doesn't break dependency injection

Acceptance Criteria

  • Only safely removable properties are cleaned up
  • Future feature placeholders are clearly marked
  • Dependency injection continues to work
  • No functionality is broken or removed
  • Code intent is clearer with proper comments

Priority

Low - Safe technical debt reduction, non-critical for functionality

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority-lowLow prioritytech-debtTechnical debt that needs addressing

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions