let compute_coverage_by_fun semantic =
  let one_fun vi acc =
    try
      let kf = Globals.Functions.get vi in
      let dec = Kernel_function.get_definition kf in
      let vis = new coverageByFun (Project.current ()) in
      ignore (Visitor.visitFramacFunction (vis :> Visitor.frama_c_visitor) dec);
      let (total, value) = vis#result in
      let percent = (float_of_int value) /. (float_of_int total) *. 100. in
      (kf, total, value, percent) :: acc
    with Kernel_function.No_Definition -> acc
  in
  let res = Varinfo.Set.fold one_fun semantic [] in
  List.sort (fun (_, _, _, p1) (_, _, _, p2) -> compare p2 p1) res