@ -7,23 +7,25 @@
open ! IStd
type log_t = ? ltr : Errlog . loc_trace -> ? extras : Jsonbug_t . extra -> IssueType . t -> string -> unit
type log_t =
? ltr : Errlog . loc_trace -> ? extras : Jsonbug_t . extra -> Checker . t -> IssueType . t -> string -> unit
let log_issue_from_errlog severity err_log ~ loc ~ node ~ session ~ ltr ~ access ~ extras exn =
let log_issue_from_errlog severity err_log ~ loc ~ node ~ session ~ ltr ~ access ~ extras checker exn =
let issue_type = ( Exceptions . recognize_exception exn ) . name in
if ( not Config . filtering ) (* no-filtering takes priority *) | | issue_type . IssueType . enabled then
let doc_url = issue_type . doc_url in
let linters_def_file = issue_type . linters_def_file in
Errlog . log_issue severity err_log ~ loc ~ node ~ session ~ ltr ~ linters_def_file ~ doc_url ~ access
~ extras exn
~ extras checker exn
let log_frontend_issue severity errlog ~ loc ~ node_key ~ ltr exn =
let node = Errlog . FrontendNode { node_key } in
log_issue_from_errlog severity errlog ~ loc ~ node ~ session : 0 ~ ltr ~ access : None ~ extras : None exn
log_issue_from_errlog severity errlog ~ loc ~ node ~ session : 0 ~ ltr ~ access : None ~ extras : None Linters
exn
let log_issue_from_summary severity proc_desc err_log ~ node ~ session ~ loc ~ ltr ? extras exn =
let log_issue_from_summary severity proc_desc err_log ~ node ~ session ~ loc ~ ltr ? extras checker exn =
let procname = Procdesc . get_proc_name proc_desc in
let is_java_generated_method =
match procname with
@ -46,36 +48,37 @@ let log_issue_from_summary severity proc_desc err_log ~node ~session ~loc ~ltr ?
in
if should_suppress_lint | | is_java_generated_method | | is_java_external_package then
Logging . debug Analysis Medium " Reporting is suppressed!@ \n " (* Skip the reporting *)
else log_issue_from_errlog severity err_log ~ loc ~ node ~ session ~ ltr ~ access : None ~ extras exn
else
log_issue_from_errlog severity err_log ~ loc ~ node ~ session ~ ltr ~ access : None ~ extras checker exn
let checker_exception issue_type error_message =
Exceptions . Checkers ( issue_type , Localise . verbatim_desc error_message )
let log_issue_from_summary_simplified severity attrs err_log ~ loc ? ( ltr = [] ) ? extras issue_type
error_message =
let log_issue_from_summary_simplified severity attrs err_log ~ loc ? ( ltr = [] ) ? extras checker
issue_type error_message =
let exn = checker_exception issue_type error_message in
log_issue_from_summary severity attrs err_log ~ node : Errlog . UnknownNode ~ session : 0 ~ loc ~ ltr
? extras exn
? extras checker exn
let log_error attrs err_log ~ loc ? ltr ? extras issue_type error_message =
log_issue_from_summary_simplified Exceptions . Error attrs err_log ~ loc ? ltr ? extras issue_type
error_message
let log_error attrs err_log ~ loc ? ltr ? extras checker issue_type error_message =
log_issue_from_summary_simplified Exceptions . Error attrs err_log ~ loc ? ltr ? extras checker
issue_type error_message
let log_warning attrs err_log ~ loc ? ltr ? extras issue_type error_message =
log_issue_from_summary_simplified Exceptions . Warning attrs err_log ~ loc ? ltr ? extras issue_type
error_message
let log_warning attrs err_log ~ loc ? ltr ? extras checker issue_type error_message =
log_issue_from_summary_simplified Exceptions . Warning attrs err_log ~ loc ? ltr ? extras checker
issue_type error_message
let log_issue_external procname ~ issue_log severity ~ loc ~ ltr ? access ? extras issue_type
let log_issue_external procname ~ issue_log severity ~ loc ~ ltr ? access ? extras checker issue_type
error_message =
let exn = checker_exception issue_type error_message in
let issue_log , errlog = IssueLog . get_or_add issue_log ~ proc : procname in
let node = Errlog . UnknownNode in
log_issue_from_errlog severity errlog ~ loc ~ node ~ session : 0 ~ ltr ~ access ~ extras exn ;
log_issue_from_errlog severity errlog ~ loc ~ node ~ session : 0 ~ ltr ~ access ~ extras checker exn ;
issue_log