pub fn load_coverage_effect(
primary_path: PathBuf,
project_root: PathBuf,
) -> AnalysisEffect<CoverageData>Expand description
Load coverage data with automatic fallback strategies.
This function tries multiple coverage sources in order and returns the first one that succeeds. The fallback order is:
- User-specified primary path
- Default cargo-llvm-cov location:
target/llvm-cov-target/debug/coverage/lcov.info - Alternative lcov location:
target/coverage/lcov.info - Cargo-tarpaulin Cobertura:
target/coverage/cobertura.xml
§Example
ⓘ
use debtmap::risk::effects::load_coverage_effect;
// Try user-specified path first, then fallback to defaults
let effect = load_coverage_effect(
"my-coverage.lcov".into(),
"/path/to/project".into(),
);
let coverage = run_effect(effect, config)?;§Errors
Returns AnalysisError::CoverageError only if ALL fallback strategies fail.
The error message includes details about what was tried.