Dead Code Audit

June 6, 2026 · View on GitHub

This document records the results of a dead-code sweep across the stratux codebase. "Dead code" here means functions, methods, types, constants, global variables, and struct fields that are defined but never referenced anywhere in the repository (accounting for cross-language references such as JSON tags, HTML template bindings, and the cgo layer).

The audit was performed by reference analysis (repo-wide grep, plus the Go deadcode tool where it could build). Each finding lists a confidence level. Nothing in this audit has been removed yet — it is a backlog of candidates for cleanup. Before deleting any exported symbol, confirm it is not part of an intended public/API surface.

Last updated: 2026-06-06.

dump978/ (C)

LocationSymbolNotesConfidence
dump978/dump978.c:297check_sync_word()Global function, forward-declared but never called anywhere.High
dump978/dump978.c:73userCB (static var)Only used in the BUILD_LIB #else path; dead in the default main() build.Medium
dump978/uat2json.c:304//uat_display_adsb_mdb(...)Commented-out call.High

Not dead, but a code smell worth a follow-up: make_atan2_table and read_from_stdin in dump978.c are forward-declared static but defined non-static. Both are actually used.

Go support packages

common/, uatparse/, godump978/, sensors/bmp388/.

High confidence — zero references repo-wide

LocationSymbolKind
common/equations.go:288DistRectNorthfunc
common/equations.go:298DistRectEastfunc
common/equations.go:343IMinfunc
common/equations.go:350IMaxfunc
uatparse/uatdata.go:6UATMSG_TEXTconst
uatparse/uatdata.go:7UATMSG_NEXRADconst
uatparse/uatdata.go:8UATMSG_AIRMETconst
uatparse/uatdata.go:11AIRMET_POLYGONconst
uatparse/uatdata.go:12AIRMET_ELLIPSEconst
uatparse/uatdata.go:13AIRMET_PRISMconst
uatparse/uatdata.go:14AIRMET_3Dconst
uatparse/uatdata.go:24UATAirmettype
uatparse/uatdata.go:28UATMsgDecodedtype
godump978/godump978.go:40PackageVersionvar
godump978/godump978.go:45UserCbTtype alias
sensors/bmp388/bmp388.go:17errSoftResetvar
sensors/bmp388/registers.go:27DRDYPressconst
sensors/bmp388/registers.go:28DRDYTempconst

These are exported from internal main-module packages (not a published library), so unreferenced exports are very likely safe to remove.

Medium confidence — uatparse/uatparse.go struct fields

LocationFieldNotes
uatparse/uatparse.go:50a_fNever read.
uatparse/uatparse.go:51g_fNever read.
uatparse/uatparse.go:52p_fNever read.
uatparse/uatparse.go:53s_fWritten = true at :171, never read (has a TODO).
uatparse/uatparse.go:34FISB_monthRead only by test/getairmet.go, not by production code.
uatparse/uatparse.go:35FISB_dayRead only by test/getairmet.go, not by production code.
uatparse/uatparse.go:38FISB_secondsRead only by test/getairmet.go, not by production code.

Web JS frontend

web/js/main.js, web/plates/js/*.js (third-party libraries excluded). Cross-referenced against the AngularJS HTML templates so template-bound functions are not falsely flagged.

LocationSymbolNotesConfidence
web/plates/js/developer.js:107webUIRefresh()$scope method, no template/JS callers.High
web/plates/js/settings.js:468pongUpdateRun()Broken/orphaned (references undefined inputfile); template uses uploadPongFile() instead.High
web/plates/js/status.js:336GetDeveloperModeClick()$scope method, no callers.High
web/plates/js/map.js:378aircraft.posHistroy = ...Typo'd property assignment (posHistroy vs posHistory); written, never read.Medium

Go main/ package

A manual sweep of 300+ unexported functions, methods, types, globals, and constants found no definitive dead code. Logging, parsers, network/sensor functions, connection-type methods, and reflection-used marshal functions are all referenced.

Caveat: this verdict is from manual reference analysis, not a static analyzer — the Go deadcode tool could not run because of unsatisfied cgo dependencies. For higher assurance, get go run golang.org/x/tools/cmd/deadcode ./... building once the cgo deps are satisfied.