Drop 10 dead parser-compat columns (srccallsign, dstcallsign,
origpacket, body, header, alive, posambiguity, symboltable,
symbolcode, messaging) and move 14 display-only columns into a
single `data` JSONB column (PHG, telemetry, radiorange,
information_field, format, posresolution, position_ambiguity,
luminosity, rain_midnight).
Reduces row width from ~70 to ~48 columns. Table is ephemeral
so migration uses DROP/recreate. Also fixes snow_24h -> snow bug
in weather check query and adds null byte stripping for JSONB
string sanitization.
Historical map loading previously fetched all 73 columns (SELECT *) from
the packets table (~2068 bytes/row). Added get_recent_packets_for_map/1
with select_map_fields/1 that fetches only the 22 columns needed for map
rendering (~200 bytes/row), yielding a ~3x query speedup.
Also removes unused all_packets tracking from PacketProcessor and
simplifies visible_packets cleanup in Index.
Resolves the final 5 Credo cyclomatic complexity issues by:
1. packet.ex: Create get_field_value/2 helper function
- Replaces all `data[:field] || data["field"]` patterns
- Reduces complexity in put_equipment_fields (11 -> 9)
- Reduces complexity in put_phg_fields (12 -> 9)
- Reduces complexity in put_standard_parser_fields (11 -> 9)
2. query_builder.ex: Use SQL fragment for weather_only query
- Replaces multiple Elixir `or` operators with single SQL fragment
- Reduces complexity from 10 to within limits
3. packet_utils.ex: Use SQL fragment for weather check query
- Replaces multiple Elixir `or` operators with single SQL fragment
- Reduces complexity from 11 to within limits
All 71 Credo issues now resolved:
- 14/14 warnings ✓
- 14/14 design suggestions ✓
- 40/40 refactoring issues ✓
- 3/3 code readability issues ✓
100% Credo compliance achieved!
- Fix leader election guard test for :undefined pid
- Fix cpu_sup.util() pattern matching to handle numeric return
- Fix encoding_utils to always return explicit nil when needed
- Remove unused finite_float? function
- Fix signal handler to match :ok return from :os.set_signal/2
- Remove redundant catch-all pattern in database metrics
- Fix Gridsquare pattern matching in info_live template
- Remove unnecessary nil check for calculate_course result
- Fix get_packet_received_at to not check for nil (always returns DateTime)
- Remove redundant catch-all pattern in weather format_weather_value
- Fix query builder to use from(p in Packet) instead of bare Packet atom
Reduced dialyzer errors from 49 to 6. Remaining warnings are mostly
false positives from template compilation and overloaded function specs.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>