Daniel Viegas a4e12d4dbb Reduce method complexity and improve code organization
Major improvements:
- collect_events: Reduced from 74 lines/complexity 21 to 36 lines/complexity 6 (64% complexity reduction)
  * Extracted _collect_family_member_events() to eliminate duplication
  * Extracted _collect_family_events() for family-level events
  * Extracted _invalidate_cache() for cache management
  * Extracted _calculate_timeline_height() for height calculation

- draw_year_markers: Reduced from 78 lines/complexity 17 to 39 lines/complexity 7 (59% complexity reduction)
  * Extracted _find_year_range() to find min/max years
  * Extracted _calculate_year_y_position() for position calculation
  * Extracted _draw_year_marker() for drawing individual markers

- _draw_shape: Reduced from 55 lines/complexity 12 to 22 lines/complexity 1 (92% complexity reduction)
  * Extracted shape-specific methods: _draw_triangle(), _draw_circle(), _draw_diamond(),
    _draw_square(), _draw_star(), _draw_hexagon()
  * Uses dictionary-based dispatch pattern for cleaner code

Results:
- Total methods: 48 → 61 (better separation of concerns)
- Average method complexity significantly reduced
- Code is more maintainable and testable
- Each method has a single, clear responsibility
2025-11-29 00:33:45 +01:00
Description
MyTimeline Gramps plugin
822 KiB
Languages
Python 94.2%
Shell 5.8%