MCPcopy Create free account
hub / github.com/FuzzAnything/PromptFuzz / compute_branch_coverage

Method compute_branch_coverage

src/feedback/clang_coverage.rs:62–80  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

60 }
61
62 pub fn compute_branch_coverage(&self) -> f32 {
63 if self.branches.is_empty() {
64 if self.count == 0 {
65 return 0_f32;
66 }
67 return 1_f32;
68 }
69 let mut covered = 0;
70 for branch in &self.branches {
71 if branch.get_true_count() > &0 {
72 covered += 1;
73 }
74 if branch.get_false_count() > &0 {
75 covered += 1;
76 }
77 }
78 let ratio: f32 = covered as f32 / (self.branches.len() * 2) as f32;
79 ratio
80 }
81
82 pub fn get_covered_banch(&self) -> Vec<Branch> {
83 let mut covered: Vec<Branch> = Vec::new();

Callers

nothing calls this directly

Calls 3

get_true_countMethod · 0.80
get_false_countMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected