use serde::Serialize;
use crate::loc::report::LanguageReport;
#[derive(Debug, Serialize)]
pub struct ProjectReport {
pub path: String,
pub top: usize,
pub include_tests: bool,
pub min_lines: usize,
pub loc: Vec<LanguageReport>,
pub duplication: DupsSummary,
pub indent: SectionResult<IndentEntry>,
pub halstead: SectionResult<HalsteadEntry>,
pub cyclomatic: SectionResult<CycomEntry>,
pub mi_visual_studio: SectionResult<MiVisualStudioEntry>,
pub mi_verifysoft: SectionResult<MiVerifysoftEntry>,
}
#[derive(Debug, Serialize)]
pub struct SectionResult<T> {
pub description: &'static str,
pub total_count: usize,
pub entries: Vec<T>,
}
#[derive(Debug, Serialize)]
pub struct DupsSummary {
pub description: &'static str,
pub total_code_lines: usize,
pub duplicated_lines: usize,
pub duplication_percentage: f64,
pub duplicate_groups: usize,
pub files_with_duplicates: usize,
pub largest_block: usize,
}
#[derive(Debug, Serialize)]
pub struct IndentEntry {
pub path: String,
pub code_lines: usize,
pub stddev: f64,
pub max_depth: usize,
pub complexity: String,
}
#[derive(Debug, Serialize)]
pub struct HalsteadEntry {
pub path: String,
pub volume: f64,
pub effort: f64,
pub bugs: f64,
pub time: f64,
}
#[derive(Debug, Serialize)]
pub struct CycomEntry {
pub path: String,
pub functions: usize,
pub total: usize,
pub max: usize,
pub avg: f64,
pub level: String,
}
#[derive(Debug, Serialize)]
pub struct MiVisualStudioEntry {
pub path: String,
pub mi_score: f64,
pub level: String,
}
#[derive(Debug, Serialize)]
pub struct MiVerifysoftEntry {
pub path: String,
pub mi_score: f64,
pub level: String,
}