[infer] remove the field procedure_id in the analysis report

Summary: The `procedure_id` is not used in the final report

Reviewed By: mbouaziz

Differential Revision: D9176276

fbshipit-source-id: 2397b01c4
master
Jeremy Dubreil 6 years ago committed by Facebook Github Bot
parent 5a4d4f0882
commit 3cffdb9745

@ -29,7 +29,6 @@ type jsonbug = {
line: int; line: int;
column: int; column: int;
procedure : string; procedure : string;
procedure_id : string;
procedure_start_line : int; procedure_start_line : int;
file : string; file : string;
bug_trace : json_trace_item list; bug_trace : json_trace_item list;

@ -311,7 +311,6 @@ module JsonIssuePrinter = MakeJsonListPrinter (struct
; line= err_data.loc.Location.line ; line= err_data.loc.Location.line
; column= err_data.loc.Location.col ; column= err_data.loc.Location.col
; procedure ; procedure
; procedure_id= Typ.Procname.to_filename proc_name
; procedure_start_line ; procedure_start_line
; file ; file
; bug_trace= loc_trace_to_jsonbug_record err_data.loc_trace err_key.severity ; bug_trace= loc_trace_to_jsonbug_record err_data.loc_trace err_key.severity
@ -408,8 +407,6 @@ let pp_custom_of_report fmt report fields =
Format.fprintf fmt "%s%d" (comma_separator index) issue.column Format.fprintf fmt "%s%d" (comma_separator index) issue.column
| `Issue_field_procedure -> | `Issue_field_procedure ->
Format.fprintf fmt "%s%s" (comma_separator index) issue.procedure Format.fprintf fmt "%s%s" (comma_separator index) issue.procedure
| `Issue_field_procedure_id ->
Format.fprintf fmt "%s%s" (comma_separator index) issue.procedure_id
| `Issue_field_procedure_start_line -> | `Issue_field_procedure_start_line ->
Format.fprintf fmt "%s%d" (comma_separator index) issue.procedure_start_line Format.fprintf fmt "%s%d" (comma_separator index) issue.procedure_start_line
| `Issue_field_file -> | `Issue_field_file ->
@ -423,8 +420,6 @@ let pp_custom_of_report fmt report fields =
| `Issue_field_line_offset -> | `Issue_field_line_offset ->
Format.fprintf fmt "%s%d" (comma_separator index) Format.fprintf fmt "%s%d" (comma_separator index)
(issue.line - issue.procedure_start_line) (issue.line - issue.procedure_start_line)
| `Issue_field_procedure_id_without_crc ->
Format.fprintf fmt "%s%s" (comma_separator index) (DB.strip_crc issue.procedure_id)
| `Issue_field_qualifier_contains_potential_exception_note -> | `Issue_field_qualifier_contains_potential_exception_note ->
Format.pp_print_bool fmt Format.pp_print_bool fmt
(String.is_substring issue.qualifier ~substring:potential_exception_message) (String.is_substring issue.qualifier ~substring:potential_exception_message)

@ -58,14 +58,12 @@ let issues_fields_symbols =
; ("line", `Issue_field_line) ; ("line", `Issue_field_line)
; ("column", `Issue_field_column) ; ("column", `Issue_field_column)
; ("procedure", `Issue_field_procedure) ; ("procedure", `Issue_field_procedure)
; ("procedure_id", `Issue_field_procedure_id)
; ("procedure_start_line", `Issue_field_procedure_start_line) ; ("procedure_start_line", `Issue_field_procedure_start_line)
; ("file", `Issue_field_file) ; ("file", `Issue_field_file)
; ("bug_trace", `Issue_field_bug_trace) ; ("bug_trace", `Issue_field_bug_trace)
; ("key", `Issue_field_key) ; ("key", `Issue_field_key)
; ("hash", `Issue_field_hash) ; ("hash", `Issue_field_hash)
; ("line_offset", `Issue_field_line_offset) ; ("line_offset", `Issue_field_line_offset)
; ("procedure_id_without_crc", `Issue_field_procedure_id_without_crc)
; ( "qualifier_contains_potential_exception_note" ; ( "qualifier_contains_potential_exception_note"
, `Issue_field_qualifier_contains_potential_exception_note ) ] , `Issue_field_qualifier_contains_potential_exception_note ) ]

@ -406,14 +406,12 @@ val issues_fields :
| `Issue_field_line | `Issue_field_line
| `Issue_field_column | `Issue_field_column
| `Issue_field_procedure | `Issue_field_procedure
| `Issue_field_procedure_id
| `Issue_field_procedure_start_line | `Issue_field_procedure_start_line
| `Issue_field_file | `Issue_field_file
| `Issue_field_bug_trace | `Issue_field_bug_trace
| `Issue_field_key | `Issue_field_key
| `Issue_field_hash | `Issue_field_hash
| `Issue_field_line_offset | `Issue_field_line_offset
| `Issue_field_procedure_id_without_crc
| `Issue_field_qualifier_contains_potential_exception_note ] | `Issue_field_qualifier_contains_potential_exception_note ]
list list

@ -28,11 +28,6 @@ let append_crc_cutoff ?(key= "") ?(crc_only= false) name =
if crc_only then crc_str else Printf.sprintf "%s%c%s" name_up_to_cutoff crc_token crc_str if crc_only then crc_str else Printf.sprintf "%s%c%s" name_up_to_cutoff crc_token crc_str
(* Lengh of .crc part: 32 characters of digest, plus 1 character of crc_token *)
let dot_crc_len = 1 + 32
let strip_crc str = String.slice str 0 (-dot_crc_len)
let curr_source_file_encoding = `Enc_crc let curr_source_file_encoding = `Enc_crc
(** string encoding of a source file (including path) as a single filename *) (** string encoding of a source file (including path) as a single filename *)

@ -61,9 +61,6 @@ val append_crc_cutoff : ?key:string -> ?crc_only:bool -> string -> string
Use an optional key to compute the crc. Use an optional key to compute the crc.
Return only the crc if [crc_only] is true. *) Return only the crc if [crc_only] is true. *)
val strip_crc : string -> string
(** Strip any crc attached to any string generated by string_append_crc_cutoff *)
val source_file_encoding : SourceFile.t -> string val source_file_encoding : SourceFile.t -> string
(** string encoding of a source file (including path) as a single filename *) (** string encoding of a source file (including path) as a single filename *)

@ -9,11 +9,10 @@ open! IStd
let create_fake_jsonbug ?(bug_class= "bug_class") ?(kind= "kind") ?(bug_type= "bug_type") let create_fake_jsonbug ?(bug_class= "bug_class") ?(kind= "kind") ?(bug_type= "bug_type")
?(qualifier= "qualifier") ?(severity= "severity") ?(visibility= "visibility") ?(line= 1) ?(qualifier= "qualifier") ?(severity= "severity") ?(visibility= "visibility") ?(line= 1)
?(column= 1) ?(procedure= "procedure") ?(procedure_id= "procedure_id") ?(column= 1) ?(procedure= "procedure") ?(procedure_start_line= 1)
?(procedure_start_line= 1) ?(file= "file/at/a/certain/path.java") ?(bug_trace= []) ?(file= "file/at/a/certain/path.java") ?(bug_trace= []) ?(node_key= "File|method|TYPE")
?(node_key= "File|method|TYPE") ?(key= "1234") ?(hash= "1") ?(dotty= None) ?(key= "1234") ?(hash= "1") ?(dotty= None) ?(infer_source_loc= None)
?(infer_source_loc= None) ?(linters_def_file= Some "file/at/certain/path.al") ?doc_url () ?(linters_def_file= Some "file/at/certain/path.al") ?doc_url () : Jsonbug_t.jsonbug =
: Jsonbug_t.jsonbug =
{ bug_class { bug_class
; kind ; kind
; bug_type ; bug_type
@ -23,7 +22,6 @@ let create_fake_jsonbug ?(bug_class= "bug_class") ?(kind= "kind") ?(bug_type= "b
; line ; line
; column ; column
; procedure ; procedure
; procedure_id
; procedure_start_line ; procedure_start_line
; file ; file
; bug_trace ; bug_trace

@ -1,5 +1,5 @@
NULL_DEREFERENCE, no_bucket, src/com/example/DiffClass1.java, com.example.DiffClass1.triggerNpe():int, 1, com.example.DiffClass1.triggerNpe():int.0f35dc00a0f5d9c32cb58361b79c5a0c, com.example.DiffClass1.triggerNpe():int NULL_DEREFERENCE, no_bucket, src/com/example/DiffClass1.java, com.example.DiffClass1.triggerNpe():int, 1
RESOURCE_LEAK, no_bucket, src/com/example/DiffClass2.java, com.example.DiffClass2.openResource():void, 5, com.example.DiffClass2.openResource():void.6561ab0ad86c3847cc965b847ac80324, com.example.DiffClass2.openResource():void RESOURCE_LEAK, no_bucket, src/com/example/DiffClass2.java, com.example.DiffClass2.openResource():void, 5
NULL_DEREFERENCE, no_bucket, src/com/example/DiffClass3.java, com.example.DiffClassThree.doStuff3():int, 1, com.example.DiffClassThree.doStuff3():int.d5d2e8b4c4f1e60721b0e4cebf811191, com.example.DiffClassThree.doStuff3():int NULL_DEREFERENCE, no_bucket, src/com/example/DiffClass3.java, com.example.DiffClassThree.doStuff3():int, 1
NULL_DEREFERENCE, no_bucket, src/com/example/DiffClassUnchanged.java, com.example.DiffClassUnchanged.doWrongStuff():int, 1, com.example.DiffClassUnchanged.doWrongStuff():int.8aa1760ea64381fc9a842a0c0c3f0909, com.example.DiffClassUnchanged.doWrongStuff():int NULL_DEREFERENCE, no_bucket, src/com/example/DiffClassUnchanged.java, com.example.DiffClassUnchanged.doWrongStuff():int, 1
NULL_DEREFERENCE, no_bucket, src/com/example/DiffClassUnchanged.java, com.example.DiffClassUnchanged.tellMeTheLength():int, 1, com.example.DiffClassUnchanged.tellMeTheLength():int.06e7bdb4fc272c724e2b9dfc4e5026dc, com.example.DiffClassUnchanged.tellMeTheLength():int NULL_DEREFERENCE, no_bucket, src/com/example/DiffClassUnchanged.java, com.example.DiffClassUnchanged.tellMeTheLength():int, 1

@ -1 +1 @@
NULL_DEREFERENCE, no_bucket, src/com/example/DiffClass2.java, com.example.DiffClass2.doStuff():int, 1, com.example.DiffClass2.doStuff():int.0bd745e5e0ee00c272a09256adbe19d2, com.example.DiffClass2.doStuff():int NULL_DEREFERENCE, no_bucket, src/com/example/DiffClass2.java, com.example.DiffClass2.doStuff():int, 1

@ -1,2 +1,2 @@
NULL_DEREFERENCE, no_bucket, src/com/example/DiffClass3.java, com.example.DiffClassThree.doStuff3():int, 1, com.example.DiffClassThree.doStuff3():int.d5d2e8b4c4f1e60721b0e4cebf811191, com.example.DiffClassThree.doStuff3():int NULL_DEREFERENCE, no_bucket, src/com/example/DiffClass3.java, com.example.DiffClassThree.doStuff3():int, 1
NULL_DEREFERENCE, no_bucket, src/com/example/DiffClassUnchanged.java, com.example.DiffClassUnchanged.tellMeTheLength():int, 1, com.example.DiffClassUnchanged.tellMeTheLength():int.06e7bdb4fc272c724e2b9dfc4e5026dc, com.example.DiffClassUnchanged.tellMeTheLength():int NULL_DEREFERENCE, no_bucket, src/com/example/DiffClassUnchanged.java, com.example.DiffClassUnchanged.tellMeTheLength():int, 1

@ -1 +1 @@
RESOURCE_LEAK, no_bucket, src/com/example/DiffClass2.java, com.example.DiffClass2.openResource():void, 5, com.example.DiffClass2.openResource():void.6561ab0ad86c3847cc965b847ac80324, com.example.DiffClass2.openResource():void RESOURCE_LEAK, no_bucket, src/com/example/DiffClass2.java, com.example.DiffClass2.openResource():void, 5

@ -1,4 +1,4 @@
NULL_DEREFERENCE, no_bucket, src/com/example/DiffClass1.java, com.example.DiffClass1.triggerNpe():int, 1, com.example.DiffClass1.triggerNpe():int.0f35dc00a0f5d9c32cb58361b79c5a0c, com.example.DiffClass1.triggerNpe():int NULL_DEREFERENCE, no_bucket, src/com/example/DiffClass1.java, com.example.DiffClass1.triggerNpe():int, 1
NULL_DEREFERENCE, no_bucket, src/com/example/DiffClass2.java, com.example.DiffClass2.doStuff():int, 1, com.example.DiffClass2.doStuff():int.0bd745e5e0ee00c272a09256adbe19d2, com.example.DiffClass2.doStuff():int NULL_DEREFERENCE, no_bucket, src/com/example/DiffClass2.java, com.example.DiffClass2.doStuff():int, 1
RESOURCE_LEAK, no_bucket, src/com/example/DiffClass2.java, com.example.DiffClass2.openResource():void, 5, com.example.DiffClass2.openResource():void.6561ab0ad86c3847cc965b847ac80324, com.example.DiffClass2.openResource():void RESOURCE_LEAK, no_bucket, src/com/example/DiffClass2.java, com.example.DiffClass2.openResource():void, 5
NULL_DEREFERENCE, no_bucket, src/com/example/DiffClassUnchanged.java, com.example.DiffClassUnchanged.doWrongStuff():int, 1, com.example.DiffClassUnchanged.doWrongStuff():int.8aa1760ea64381fc9a842a0c0c3f0909, com.example.DiffClassUnchanged.doWrongStuff():int NULL_DEREFERENCE, no_bucket, src/com/example/DiffClassUnchanged.java, com.example.DiffClassUnchanged.doWrongStuff():int, 1

@ -1 +1 @@
NULL_DEREFERENCE, no_bucket, src/DiffExample.java, DiffExample$3$1.doSomething():void, 1, DiffExample$3$1.doSomething():void.64afb6aca478af18163141bbb8999018, DiffExample$3$1.doSomething():void NULL_DEREFERENCE, no_bucket, src/DiffExample.java, DiffExample$3$1.doSomething():void, 1

@ -1 +1 @@
NULL_DEREFERENCE, no_bucket, src/DiffExample.java, DiffExample$4.aaa():int, 0, DiffExample$4.aaa():int.a7bd5e834e7a8fb4284c75f621544e3e, DiffExample$4.aaa():int NULL_DEREFERENCE, no_bucket, src/DiffExample.java, DiffExample$4.aaa():int, 0

@ -1,2 +1,2 @@
RESOURCE_LEAK, no_bucket, src/DiffExample.java, DiffExample.openResource():void, 5, DiffExample.openResource():void.c57b56c0042a220d7416e229c4e61b99, DiffExample.openResource():void RESOURCE_LEAK, no_bucket, src/DiffExample.java, DiffExample.openResource():void, 5
NULL_DEREFERENCE, no_bucket, src/DiffExampleTwo.java, DiffExampleTwo.doSomethingTwo():void, 1, DiffExampleTwo.doSomethingTwo():void.d8149869686ac2ef26a75ac4829094a7, DiffExampleTwo.doSomethingTwo():void NULL_DEREFERENCE, no_bucket, src/DiffExampleTwo.java, DiffExampleTwo.doSomethingTwo():void, 1

@ -1 +1 @@
NULL_DEREFERENCE, no_bucket, src/DiffExample.java, DiffExample.triggerNpeRenamed():int, 1, DiffExample.triggerNpeRenamed():int.3e4070b89fdefd2c64fd437530b8dda9, DiffExample.triggerNpeRenamed():int NULL_DEREFERENCE, no_bucket, src/DiffExample.java, DiffExample.triggerNpeRenamed():int, 1

@ -1,2 +1,2 @@
RESOURCE_LEAK, no_bucket, src/DiffExampleRenamed.java, DiffExampleRenamed.openResource():void, 5, DiffExampleRenamed.openResource():void.715df29eeb5b62c29d4081c6dc9d407a, DiffExampleRenamed.openResource():void RESOURCE_LEAK, no_bucket, src/DiffExampleRenamed.java, DiffExampleRenamed.openResource():void, 5
NULL_DEREFERENCE, no_bucket, src/DiffExampleRenamed.java, DiffExampleRenamed.triggerNpe():int, 1, DiffExampleRenamed.triggerNpe():int.708d86c0dc5dc4e5dbbbcd38276ce86f, DiffExampleRenamed.triggerNpe():int NULL_DEREFERENCE, no_bucket, src/DiffExampleRenamed.java, DiffExampleRenamed.triggerNpe():int, 1

@ -11,7 +11,7 @@ include $(TESTS_DIR)/base.make
INFER_OUT = infer-out INFER_OUT = infer-out
EXPECTED_TEST_OUTPUT = introduced.exp.test EXPECTED_TEST_OUTPUT = introduced.exp.test
INFERPRINT_ISSUES_FIELDS = \ INFERPRINT_ISSUES_FIELDS = \
"bug_type,bucket,file,procedure,line_offset,procedure_id,procedure_id_without_crc" "bug_type,bucket,file,procedure,line_offset"
CURRENT_DIR = infer-out-current CURRENT_DIR = infer-out-current
PREVIOUS_DIR = infer-out-previous PREVIOUS_DIR = infer-out-previous

Loading…
Cancel
Save