use crate::cli;
use std::path::PathBuf;
#[derive(Debug)]
pub struct ValidateConfig {
pub path: PathBuf,
pub config: Option<PathBuf>,
pub coverage_file: Option<PathBuf>,
pub format: Option<cli::OutputFormat>,
pub output: Option<PathBuf>,
pub enable_context: bool,
pub context_providers: Option<Vec<String>>,
pub disable_context: Option<Vec<String>>,
pub max_debt_density: Option<f64>,
pub top: Option<usize>,
pub tail: Option<usize>,
pub semantic_off: bool,
pub verbosity: u8,
pub no_parallel: bool,
pub jobs: usize,
pub show_splits: bool,
}
pub struct ValidationDetails {
pub average_complexity: f64,
pub max_average_complexity: f64,
pub high_complexity_count: usize,
pub max_high_complexity_count: usize,
pub debt_items: usize,
pub max_debt_items: usize,
pub total_debt_score: u32,
pub max_total_debt_score: u32,
pub debt_density: f64,
pub max_debt_density: f64,
pub codebase_risk_score: f64,
pub max_codebase_risk_score: f64,
pub high_risk_functions: usize,
pub max_high_risk_functions: usize,
pub coverage_percentage: f64,
pub min_coverage_percentage: f64,
}
pub struct ThresholdCheckResult {
pub passed: bool,
pub checks: Vec<CheckResult>,
}
#[derive(Debug, Clone)]
pub struct CheckResult {
pub name: &'static str,
pub passed: bool,
pub actual: f64,
pub threshold: f64,
pub is_deprecated: bool,
}
impl ThresholdCheckResult {
pub fn from_checks(checks: Vec<CheckResult>) -> Self {
let passed = checks.iter().all(|c| c.passed);
Self { passed, checks }
}
}