Input-validation and edge-case bugs found in the v1.1.0 audit

Aperta
#210 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@feralaes ci sta già lavorando.

Dal 13/11/2026.

  • #238 di @feralaes — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
3-5 giorni
Idoneità per principianti
15/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
r

Direzione di ricerca

This is a bundle of seven separate bugs, and pull request #238 is already open against it, so the work is claimed. Start from R/twsa.R:34 and R/create_sa.R:76-100, which show the outcome matching and the strategy-name checks. Each item needs a failing regression test before its fix. Done means every item has a test and NEWS has matching Bug fixes bullets.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Suggested owner: Jorge Roa · Plan: Phase 2b

Goal

Several functions give cryptic errors, or silently wrong results, on valid or near-valid input. Fix each item with a regression test.

Scope

  • twsa() on a dsa_twoway object fails with the default outcome. Code-verified.
    • R/twsa.R:34 calls match.arg(outcome) only in the psa branch.
    • The dsa_twoway branch passes the 6-element default straight to calculate_outcome() (R/twsa.R:57).
    • calculate_outcome() matches against a different 8-element choice vector (R/calculate_outcome.R:9-10), so the call errors with "'arg' must be of length 1".
    • Fix: move outcome <- match.arg(outcome) above the branch.
  • make_psa_obj() with the wrong number of strategy names gives "missing value where TRUE/FALSE needed". Reproduced.
    • The comparison loop at R/create_sa.R:76 runs before the length check at R/create_sa.R:88.
    • Move the check first. Shared with #208.
  • other_outcome columns are never renamed to the strategy names. Reproduced: names stay Chemo_Cost Radio_Cost Surg_Cost.
    • R/create_sa.R:94-100 renames cost and effectiveness only.
  • plot.evsi() condition has a misplaced parenthesis. Code-verified.
    • R/evsi.R:324: length(unique(x$WTP > 1)) should be length(unique(x$WTP)) > 1.
  • Dead FUN validity guard in the DSA runners. Code-verified.
    • R/run_dsa.R:77 and R/run_dsa.R:247 use is.na(sum(is.na(jj))), which is always FALSE. This is the same pattern as R/run_psa.R:47 in #174; fix it the same way.
  • plot.exp_loss(col = "bw") ignores lsize. Code-verified.
    • The bw branch at R/exp_loss.R:170-171 calls geom_line(aes(linetype = ...)) without linewidth = lsize.
    • col_aes = c("color", "line") at R/exp_loss.R:175 includes "line", which add_common_aes() does not handle.
  • max.col() random tie-breaking also affects calc_exp_loss(). Code-verified.
    • R/exp_loss.R:60: max.col(-exp_loss) uses the default ties.method = "random".
    • Fix it together with #167 (R/ceac.R:85), using ties.method = "first". See the proposed comment on #167 below.

Acceptance

Each item has a test that fails before the fix. NEWS gets "Bug fixes" bullets.

Lingua principale
R
Stelle
43
Fork
14
Merge medio
4h 44m
PR unite (30g)
15

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di DARTH-git/dampack

Tutte le issue di DARTH-git/dampack

Issue simili

Altre issue su R

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.