towerops/lib/towerops_web
Graham McIntire b328dfb96e
Refactor complex functions to reduce cyclomatic complexity
Refactored three highly complex functions to improve code maintainability:

1. PollerWorker.detect_sensor_changes (complexity 33 -> ~9):
   - Extracted threshold checking logic into separate functions
   - Split event creation into focused helper functions
   - Reduced nesting by using pipe operator pattern

2. PollerWorker.detect_and_log_changes (complexity 16 -> ~5):
   - Created separate functions for each interface change type
   - Extracted event building logic into dedicated functions
   - Improved readability with clear function names

3. EquipmentLive.Show.format_duration (complexity 13 -> ~5):
   - Extracted time unit conversion into separate functions
   - Simplified pluralization logic with pattern matching
   - Reduced nested conditionals

These changes make the code easier to test, maintain, and understand
while preserving all existing functionality.
2026-01-06 13:09:51 -06:00
..
components Fix admin layout to use proper Phoenix component pattern 2026-01-06 13:04:22 -06:00
controllers Add superuser system with user impersonation for admin support 2026-01-06 12:50:10 -06:00
live Refactor complex functions to reduce cyclomatic complexity 2026-01-06 13:09:51 -06:00
endpoint.ex init 2025-12-21 11:10:43 -06:00
gettext.ex init 2025-12-21 11:10:43 -06:00
router.ex Add superuser system with user impersonation for admin support 2026-01-06 12:50:10 -06:00
telemetry.ex format 2025-12-21 11:31:08 -06:00
user_auth.ex Add superuser system with user impersonation for admin support 2026-01-06 12:50:10 -06:00