Skip to main content

validate_complexity_options

Function validate_complexity_options 

Source
pub fn validate_complexity_options(
    options: &ComplexityOptions,
) -> Result<(), ProgrammaticError>
Expand description

Validate programmatic complexity / health inputs before invoking a concrete runner.

These option contracts belong to the API boundary because NAPI and future Rust embedders construct the same ComplexityOptions type.

A relative coverage path resolves against analysis.root (the cwd when unset), exactly as the engine resolves it at read time, so a project-relative health.coverage validates against the project and not against the embedder’s working directory.

The options carry no record of which layer supplied coverage, so the path error’s context is always health.coverage, whichever of the tool parameter, FALLOW_COVERAGE, or the config field won (crate::coverage::resolve_coverage_inputs resolves that order). The sibling root error names its layer because crate::coverage::CoverageInputError carries it.

§Errors

Returns a structured programmatic error when a coverage path does not exist or when coverage_root is not an absolute prefix from the coverage data.