[DEAD-3] Dead functions & cruft: unused admin APIs, test-only entry points, unreferenced fixtures, debug leftovers #42

Closed
opened 2026-11-14 18:29:02 +01:00 by amiryahaya · 1 comment
Owner

Finding

Dead public functions: ClientCredentials.recreate_client/suspend_client/reactivate_client/list_clients (suspend being dead is itself finding H-2); NationalIDClient.renewal/2,3; Renewal.process/2 (production-dead, test-only); CertificateValidity.resolve/1; data-store wrap_with/3 and exec(:reset) never called anywhere; Issuer find/delete never called. Cruft: 6 unreferenced PEM fixtures shipped into the image; verify-issuer.sh (halts the prod node!); README pointing at deprecated start-docker.sh; 26 IO.inspect in tests; tests writing certs/ into the repo cwd; stale tracked mdid-root-ca.pem/mdid-sub-ca.pem; script numbering gap (03/05); @enforce_keys [] in clc_data.ex; :invalid_client2 atom; commented-out scaffold blocks; dead :mnesia_dir test config.

Evidence

  • client_credentials.ex:37-127; national_id_client.ex:96-117; renewal.ex:32-52; grep-verified zero call sites for each

Impact

~300+ lines of confusion; dead admin functions create false confidence (H-2); debug noise pollutes precommit output.

Fix

  • Delete dead functions or wire them (suspend_client belongs to the H-2 fix)
  • Purge fixtures/one-off scripts; clean test IO.inspect and the certs/ side effect
  • Drop stale tracked PEMs and the deprecated script reference

Line numbers refer to the initial import commit 282cb11. Source: comprehensive audit, 2026-11-12 (first review of this codebase).

## Finding Dead public functions: `ClientCredentials.recreate_client/suspend_client/reactivate_client/list_clients` (suspend being dead is itself finding H-2); `NationalIDClient.renewal/2,3`; `Renewal.process/2` (production-dead, test-only); `CertificateValidity.resolve/1`; data-store `wrap_with/3` and `exec(:reset)` never called anywhere; Issuer `find`/`delete` never called. Cruft: 6 unreferenced PEM fixtures shipped into the image; `verify-issuer.sh` (halts the prod node!); README pointing at deprecated start-docker.sh; 26 `IO.inspect` in tests; tests writing `certs/` into the repo cwd; stale tracked `mdid-root-ca.pem`/`mdid-sub-ca.pem`; script numbering gap (03/05); `@enforce_keys []` in clc_data.ex; `:invalid_client2` atom; commented-out scaffold blocks; dead `:mnesia_dir` test config. ## Evidence - `client_credentials.ex:37-127`; `national_id_client.ex:96-117`; `renewal.ex:32-52`; grep-verified zero call sites for each ## Impact ~300+ lines of confusion; dead admin functions create false confidence (H-2); debug noise pollutes precommit output. ## Fix - [ ] Delete dead functions or wire them (suspend_client belongs to the H-2 fix) - [ ] Purge fixtures/one-off scripts; clean test IO.inspect and the certs/ side effect - [ ] Drop stale tracked PEMs and the deprecated script reference _Line numbers refer to the initial import commit `282cb11`. Source: comprehensive audit, 2026-11-12 (first review of this codebase)._
Author
Owner

Verified fixed on main (1b6216b): dead functions, fixtures, debug leftovers removed; suspend_client is now wired to the admin endpoint (B5).

Verified fixed on main (1b6216b): dead functions, fixtures, debug leftovers removed; suspend_client is now wired to the admin endpoint (B5).
Sign in to join this conversation.
No description provided.