Context
process_chromosome_batch() in src/rna/dupradar/counting.rs currently takes 19 positional parameters. This was flagged during review of #84 — the addition of skip_dup_check brought it from 18 to 19.
Problem
- Hard to read and maintain — callers must get the positional order exactly right
- Easy to accidentally swap parameters of the same type (e.g. multiple
&str, bool, usize args)
- Each new feature tends to add another parameter, compounding the problem
Suggested approach
Bundle related parameters into config structs, e.g.:
struct BatchConfig<'a> {
bam_path: &'a str,
gtf_path: &'a str,
stranded: Strandedness,
paired: bool,
skip_dup_check: bool,
// ...
}
struct BatchResources<'a> {
index: &'a SpatialIndex,
interner: &'a GeneIdInterner,
qualimap_index: Option<&'a QualimapIndex>,
gene_to_biotype: &'a [u16],
// ...
}
This would make call sites self-documenting and make future parameter additions non-breaking.
Priority
Low — the current code works fine, this is a maintainability improvement.
Context
process_chromosome_batch()insrc/rna/dupradar/counting.rscurrently takes 19 positional parameters. This was flagged during review of #84 — the addition ofskip_dup_checkbrought it from 18 to 19.Problem
&str,bool,usizeargs)Suggested approach
Bundle related parameters into config structs, e.g.:
This would make call sites self-documenting and make future parameter additions non-breaking.
Priority
Low — the current code works fine, this is a maintainability improvement.