Commit graph

2 commits

Author SHA1 Message Date
b5512f2579 fix: resolve credo warnings — refactor decoder_macros complexity and remove unused assign indirection
Some checks failed
Build base image / Build and push base image (push) Failing after 2s
Production Deployment / Run ExUnit Tests (push) Failing after 58s
Production Deployment / Build and Push Docker Image (push) Has been skipped
- Refactored build_field_handler_ast to use pattern-matching function heads
  instead of a large cond block, reducing cyclomatic complexity from 30 to ≤9
- Extracted classify_type_spec and per-type AST builder helpers into separate
  private functions for maintainability
- Removed :previous_interface_stats initialization from show.ex (only
  polling.ex reads it); prev_stats now passed explicitly as a parameter
  to polling functions instead of reaching through socket.assigns
- Updated Polling.poll_sensors, poll_traffic, and poll_traffic_with_state
  to accept prev_stats as an explicit argument
2026-07-25 09:46:19 -05:00
Graham McInitre
9d4a5f6d81 refactor: comprehensive simplification and functional programming improvements
- help_live/index.ex: 2,642→173 lines, 15 section modules + sidebar extracted
  MikroTik now real section, dead if false removed
- agent_channel.ex: 2,506→1,751 lines, 3 helper modules extracted
  (heartbeat/subscriptions/job_builder), decode_and_process/4 eliminates
  8 repeated handle_in patterns, guard-based size checks
- antenna_catalog.ex: 1,174→47 lines, 107 specs → priv/antennas/catalog.json
- topology.ex: unbounded query → batched loading (100/batch),
  all guard errors fixed, zero if/case/cond conditionals
- proto: decoder_macros.ex + field_specs.ex infrastructure for
  macro-generated protobuf decoders
2026-07-21 17:03:47 -05:00