aprs.me/lib/aprsme_web
Graham McIntire c5a82b77c1
refactor: pattern-match over conditionals in Navigation and InsertOptimizer
Swaps `if`/`cond` branches for multi-clause function heads or head-pattern
matching, making the control flow visible in the function signatures:

- Navigation.determine_map_location: resolve_location/4 now dispatches on
  the shape of the geolocation input and whether URL params are explicit.
- Navigation.handle_callsign_tracking: per-case clauses for empty callsign
  and explicit-URL-params short-circuits, plus a final clause that does the
  DB lookup and rescues once.
- Navigation.handle_callsign_search: dispatch_callsign_search/3 separates
  the valid/invalid callsign branches.
- InsertOptimizer.optimize_based_on_performance: pattern-match on
  [_, _, _ | _] to require ≥3 samples without calling length/1.
- InsertOptimizer.calculate_insert_options and throughput helpers split
  into guarded clauses instead of inline `if`.
- maybe_emit_optimization uses same-var pattern matching to skip the
  telemetry hit when nothing changed.

Adds unit tests covering every branch of both modules plus SignalHandler,
LocaleHook, and the InsertOptimizer's :noproc fallback path. Coverage
64.69% → 65.72%.
2026-04-23 13:38:24 -05:00
..
channels perf(packets): keyset-based pagination for recent-packet queries 2026-04-21 10:15:04 -05:00
components fix: address security vulnerabilities and concurrency issues 2026-03-23 16:59:09 -05:00
controllers chore(dialyzer): enable stricter flags and fix 97 resulting findings 2026-04-21 10:07:01 -05:00
live refactor: pattern-match over conditionals in Navigation and InsertOptimizer 2026-04-23 13:38:24 -05:00
plugs chore(dialyzer): enable stricter flags and fix 97 resulting findings 2026-04-21 10:07:01 -05:00
aprs_symbol.ex chore(dialyzer): enable stricter flags and fix 97 resulting findings 2026-04-21 10:07:01 -05:00
endpoint.ex fix: performance improvements and bug fixes across backend and frontend 2026-03-19 12:41:36 -05:00
gettext.ex more languages 2025-07-06 10:08:58 -05:00
router.ex feat: add sitemap.xml, api-catalog, and agent-discovery Link headers 2026-04-17 13:31:21 -05:00
telemetry.ex Fix code review findings: security, correctness, performance, dead code 2026-02-19 18:49:27 -06:00
time_helpers.ex improve dialyzer 2025-10-13 10:02:15 -05:00
time_utils.ex improve dialyzer 2025-10-13 10:02:15 -05:00
user_auth.ex chore(dialyzer): enable stricter flags and fix 97 resulting findings 2026-04-21 10:07:01 -05:00
weather_units.ex Refactor conditionals to use multi-clause pattern matching 2026-02-10 17:15:49 -06:00