calculate_lmdi: period_targets computed but never surfaced (output_format = "total" dead path)
#248 建立於 2026年7月22日
倉庫指標
- 星標
- (1 顆星)
- PR 合併指標
- (PR 指標待抓取)
描述
What
.lmdi_build_result (R/calculate_lmdi.R:1082-1099) builds period_target_df, .lmdi_process_all_groups (:1116-1183) collects it into all_results$period_targets, and it is returned — but .lmdi_format_output (:1206-1236) reads only all_results$results and never touches period_targets in either the "clean" or "total" branch.
Why it matters
Pure dead code; the "total" format presumably intended to surface this period-level summary (t0/t_t/target_initial/target_final/total_change).
Suggested fix / check
Either expose period_targets in the "total" output or remove the unused plumbing.
From deep static audit (2026-07-23), round 4, parallel subsystem review. Deduplicated against open+closed issues. Findings confirmed by running the functions unless stated.