1use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct Report {
8 pub title: String,
10
11 pub generated_at: String,
13
14 pub program: String,
16
17 pub invariants_checked: usize,
19
20 pub violations_found: usize,
22
23 pub coverage_percent: u8,
25
26 pub protected_functions: Vec<String>,
28
29 pub unprotected_functions: Vec<String>,
31
32 pub severity_breakdown: SeverityBreakdown,
34}
35
36#[derive(Debug, Clone, Default, Serialize, Deserialize)]
38pub struct SeverityBreakdown {
39 pub critical: usize,
41 pub high: usize,
43 pub medium: usize,
45 pub low: usize,
47}
48
49impl Report {
50 pub fn new(title: String, program: String) -> Self {
52 Self {
53 title,
54 generated_at: chrono::Utc::now().to_rfc3339(),
55 program,
56 invariants_checked: 0,
57 violations_found: 0,
58 coverage_percent: 0,
59 protected_functions: Vec::new(),
60 unprotected_functions: Vec::new(),
61 severity_breakdown: SeverityBreakdown::default(),
62 }
63 }
64}