towerops/lib/towerops_web/live
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
..
admin Add superuser system with user impersonation for admin support 2026-01-06 12:50:10 -06:00
alert_live fix dialyzer things 2026-01-03 12:56:40 -06:00
equipment_live Refactor complex functions to reduce cyclomatic complexity 2026-01-06 13:09:51 -06:00
graph_live Fix boolean attribute rendering for traffic graph 2026-01-05 13:48:59 -06:00
org_live Add global header to new organization page 2026-01-04 11:41:26 -06:00
site_live Add back navigation links to edit pages 2026-01-04 13:35:31 -06:00
dashboard_live.ex fix dialyzer things 2026-01-03 12:56:40 -06:00
dashboard_live.html.heex Add onboarding wizard to guide users through site creation 2026-01-04 11:47:25 -06:00