eduaguilera/whep

calculate_lmdi: period_targets computed but never surfaced (output_format = "total" dead path)

Aperta

#248 aperta il 22 lug 2026

 (1 commento) (0 reazioni) (0 assegnatari)R (3 fork)auto 404
area:lmdi-decompclean codegood first issuehelp wantedmechanicalno-data-neededpriority:low

Metriche repository

Star
 (1 stella)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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.

Guida contributor