aprs.me/test/aprsme
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
..
accounts test: broaden unit & property-test coverage (61.8% → 64.7%) 2026-04-23 13:32:09 -05:00
cluster perf: optimize slow tests - 40% reduction in top 10 slowest tests 2026-03-03 10:47:40 -06:00
is Add TCP backpressure to packet pipeline 2026-02-19 15:31:51 -06:00
packets fix: stabilize moving station tracking 2026-03-26 18:48:43 -05:00
performance refactor: pattern-match over conditionals in Navigation and InsertOptimizer 2026-04-23 13:38:24 -05:00
workers fix: close review findings 2026-03-26 12:36:50 -05:00
bad_packet_test.exs refactor to use external parser 2025-06-24 14:22:09 -05:00
broadcast_task_supervisor_test.exs Fix code review findings: security, correctness, performance, dead code 2026-02-19 18:49:27 -06:00
cache_test.exs Fix code review batch 3: auth, performance, dedup, cache TTL 2026-02-20 07:29:27 -06:00
callsign_test.exs test: broaden unit & property-test coverage (61.8% → 64.7%) 2026-04-23 13:32:09 -05:00
circuit_breaker_test.exs Fix code review findings: security, correctness, performance, dead code 2026-02-19 18:49:27 -06:00
cleanup_scheduler_test.exs test: broaden unit & property-test coverage (61.8% → 64.7%) 2026-04-23 13:32:09 -05:00
connection_monitor_test.exs fix: guard connection monitor stats lookup 2026-03-22 17:09:07 -05:00
connection_prevention_test.exs refactor to use external parser 2025-06-24 14:22:09 -05:00
convert_test.exs test: broaden unit & property-test coverage (61.8% → 64.7%) 2026-04-23 13:32:09 -05:00
data_extended_test.exs fix messaging name 2025-06-24 14:29:47 -05:00
db_optimizer_test.exs Fix APRS object name extraction for names with special characters 2026-02-19 18:41:37 -06:00
deployment_notifier_test.exs test: broaden unit & property-test coverage (61.8% → 64.7%) 2026-04-23 13:32:09 -05:00
device_cache_test.exs fix: guard device cache refresh when stopped 2026-03-22 17:31:54 -05:00
device_identification_test.exs test: broaden unit & property-test coverage (61.8% → 64.7%) 2026-04-23 13:32:09 -05:00
device_parser_test.exs test: broaden unit & property-test coverage (61.8% → 64.7%) 2026-04-23 13:32:09 -05:00
dynamic_supervisor_test.exs Add tests for 14 modules with 0% coverage 2026-02-09 17:19:50 -06:00
encoding_test.exs Fix APRS object display and comment encoding issues 2026-02-20 18:06:32 -06:00
encoding_utils_test.exs Fix APRS object display and comment encoding issues 2026-02-20 18:06:32 -06:00
enhanced_parser_test.exs Consolidate 24 packet columns into JSONB data field 2026-02-20 13:02:47 -06:00
error_handler_test.exs Add tests for 14 modules with 0% coverage 2026-02-09 17:19:50 -06:00
error_notifier_test.exs Add email notifications for production errors 2026-03-22 15:12:59 -05:00
geo_utils_test.exs Fix all failing tests 2025-07-25 14:14:04 -05:00
geometry_test.exs fix: Resolve majority of dialyzer type errors 2025-07-30 13:30:21 -05:00
is_test.exs fix: guard APRS send_message when disconnected 2026-03-22 17:16:44 -05:00
log_sanitizer_test.exs test: broaden unit & property-test coverage (61.8% → 64.7%) 2026-04-23 13:32:09 -05:00
maidenhead_test.exs Partition packets table by day and simplify cleanup 2026-02-20 11:25:16 -06:00
migration_lock_test.exs Add tests for 14 modules with 0% coverage 2026-02-09 17:19:50 -06:00
mock_helpers_test.exs Add tests for 14 modules with 0% coverage 2026-02-09 17:19:50 -06:00
packet_consumer_pool_test.exs Fix API documentation to match implementation 2026-02-19 10:22:10 -06:00
packet_consumer_test.exs fix: stop silent packet loss, timer leak, and seq-scans 2026-04-21 09:29:06 -05:00
packet_counter_test.exs Add tests for 14 modules with 0% coverage 2026-02-09 17:19:50 -06:00
packet_field_whitelist_test.exs test: broaden unit & property-test coverage (61.8% → 64.7%) 2026-04-23 13:32:09 -05:00
packet_geometry_test.exs Add test coverage for conversion, geometry, PHG, and encoding modules 2026-02-20 13:53:26 -06:00
packet_parsing_test.exs Consolidate 24 packet columns into JSONB data field 2026-02-20 13:02:47 -06:00
packet_pipeline_integration_test.exs Fix code review findings: security, correctness, performance, dead code 2026-02-19 18:49:27 -06:00
packet_pipeline_supervisor_test.exs Fix multiple TODO bugs: drain handler, callsign dedup, packet pipeline 2026-02-19 18:27:25 -06:00
packet_producer_backpressure_test.exs Add TCP backpressure to packet pipeline 2026-02-19 15:31:51 -06:00
packet_producer_test.exs Add TCP backpressure to packet pipeline 2026-02-19 15:31:51 -06:00
packet_replay_test.exs refactor to use external parser 2025-06-24 14:22:09 -05:00
packet_sanitizer_test.exs test: broaden unit & property-test coverage (61.8% → 64.7%) 2026-04-23 13:32:09 -05:00
packet_test.exs Add test coverage for conversion, geometry, PHG, and encoding modules 2026-02-20 13:53:26 -06:00
packet_weather_extraction_test.exs integrate /:call to main page 2025-07-13 10:36:58 -05:00
packets_encoding_test.exs Consolidate 24 packet columns into JSONB data field 2026-02-20 13:02:47 -06:00
packets_mic_e_test.exs add packet batcher 2025-06-24 15:06:09 -05:00
packets_oldest_test.exs updates with parser updates 2025-08-03 09:19:31 -05:00
packets_test.exs Optimize historical packet loading by selecting only needed columns 2026-02-20 07:41:14 -06:00
packets_weather_test.exs fix geolocation hopefully 2025-07-10 17:12:49 -05:00
partition_manager_test.exs fix: close review findings 2026-03-26 12:36:50 -05:00
regex_cache_test.exs test: broaden unit & property-test coverage (61.8% → 64.7%) 2026-04-23 13:32:09 -05:00
release_test.exs test: broaden unit & property-test coverage (61.8% → 64.7%) 2026-04-23 13:32:09 -05:00
signal_handler_test.exs refactor: pattern-match over conditionals in Navigation and InsertOptimizer 2026-04-23 13:38:24 -05:00
spatial_pubsub_test.exs fix: guard pubsub APIs when not running 2026-03-22 17:14:24 -05:00
streaming_packets_pubsub_test.exs fix: harden mobile channel numeric params 2026-03-22 17:36:09 -05:00