|
|
|
@ -136,6 +136,7 @@ let issue_of_cost cost_info ~delta ~prev_cost ~curr_cost =
|
|
|
|
|
else if CostDomain.BasicCost.is_zero curr_cost then IssueType.zero_execution_time_call
|
|
|
|
|
else IssueType.performance_variation
|
|
|
|
|
in
|
|
|
|
|
if (not Config.filtering) || issue_type.IssueType.enabled then
|
|
|
|
|
let qualifier =
|
|
|
|
|
let pp_delta fmt delta =
|
|
|
|
|
match delta with
|
|
|
|
@ -164,6 +165,7 @@ let issue_of_cost cost_info ~delta ~prev_cost ~curr_cost =
|
|
|
|
|
[Errlog.make_trace_element 0 {Location.line; col= column; file= source_file} "" []]
|
|
|
|
|
in
|
|
|
|
|
let severity = Exceptions.Warning in
|
|
|
|
|
Some
|
|
|
|
|
{ Jsonbug_j.bug_type= issue_type.IssueType.unique_id
|
|
|
|
|
; qualifier
|
|
|
|
|
; severity= Exceptions.severity_string severity
|
|
|
|
@ -171,7 +173,7 @@ let issue_of_cost cost_info ~delta ~prev_cost ~curr_cost =
|
|
|
|
|
; line
|
|
|
|
|
; column
|
|
|
|
|
; procedure= cost_info.Jsonbug_t.procedure_id
|
|
|
|
|
; procedure_start_line= 0
|
|
|
|
|
; procedure_start_line= line
|
|
|
|
|
; file
|
|
|
|
|
; bug_trace= InferPrint.loc_trace_to_jsonbug_record trace severity
|
|
|
|
|
; key= ""
|
|
|
|
@ -186,6 +188,7 @@ let issue_of_cost cost_info ~delta ~prev_cost ~curr_cost =
|
|
|
|
|
; censored_reason= InferPrint.censored_reason issue_type source_file
|
|
|
|
|
; access= None
|
|
|
|
|
; extras= None }
|
|
|
|
|
else None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(** Differential of cost reports, based on degree variations.
|
|
|
|
@ -207,18 +210,18 @@ let of_costs ~(current_costs : Jsonbug_t.costs_report) ~(previous_costs : Jsonbu
|
|
|
|
|
let curr_cost_info, curr_cost = max_degree_polynomial current in
|
|
|
|
|
let _, prev_cost = max_degree_polynomial previous in
|
|
|
|
|
let cmp = CostDomain.BasicCost.compare_by_degree curr_cost prev_cost in
|
|
|
|
|
let concat_opt l v = match v with Some v' -> v' :: l | None -> l in
|
|
|
|
|
if cmp > 0 then
|
|
|
|
|
(* introduced *)
|
|
|
|
|
let left' =
|
|
|
|
|
let issue = issue_of_cost curr_cost_info ~delta:`Increased ~prev_cost ~curr_cost in
|
|
|
|
|
issue :: left
|
|
|
|
|
issue_of_cost curr_cost_info ~delta:`Increased ~prev_cost ~curr_cost |> concat_opt left
|
|
|
|
|
in
|
|
|
|
|
(left', both, right)
|
|
|
|
|
else if cmp < 0 then
|
|
|
|
|
(* fixed *)
|
|
|
|
|
let right' =
|
|
|
|
|
let issue = issue_of_cost curr_cost_info ~delta:`Decreased ~prev_cost ~curr_cost in
|
|
|
|
|
issue :: right
|
|
|
|
|
issue_of_cost curr_cost_info ~delta:`Decreased ~prev_cost ~curr_cost
|
|
|
|
|
|> concat_opt right
|
|
|
|
|
in
|
|
|
|
|
(left, both, right')
|
|
|
|
|
else
|
|
|
|
|