pub struct RiskReport {
pub overall: RiskScore,
pub per_file: Vec<FileRisk>,
pub summary: RiskSummary,
}Expand description
Complete risk analysis for a set of diffs.
§Examples
use argus_difflens::parser::parse_unified_diff;
use argus_difflens::risk::compute_risk;
let diff = "diff --git a/f.rs b/f.rs\n\
--- a/f.rs\n\
+++ b/f.rs\n\
@@ -1,2 +1,3 @@\n\
line\n\
+new\n";
let files = parse_unified_diff(diff).unwrap();
let report = compute_risk(&files);
assert!(report.overall.total >= 0.0);Fields§
§overall: RiskScoreAggregate risk score across all files.
per_file: Vec<FileRisk>Per-file risk breakdown.
summary: RiskSummaryHigh-level summary statistics.
Implementations§
Source§impl RiskReport
impl RiskReport
Sourcepub fn to_markdown(&self) -> String
pub fn to_markdown(&self) -> String
Render the report as a markdown string.
§Examples
use argus_difflens::risk::compute_risk;
let report = compute_risk(&[]);
let md = report.to_markdown();
assert!(md.contains("# Risk Report"));Trait Implementations§
Source§impl Clone for RiskReport
impl Clone for RiskReport
Source§fn clone(&self) -> RiskReport
fn clone(&self) -> RiskReport
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RiskReport
impl Debug for RiskReport
Source§impl Display for RiskReport
impl Display for RiskReport
Auto Trait Implementations§
impl Freeze for RiskReport
impl RefUnwindSafe for RiskReport
impl Send for RiskReport
impl Sync for RiskReport
impl Unpin for RiskReport
impl UnsafeUnpin for RiskReport
impl UnwindSafe for RiskReport
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more