@@ -185,7 +185,7 @@ def create_all_function_table(
185
185
coverage_url : str ,
186
186
basefolder : str ,
187
187
table_id : Optional [str ] = None
188
- ) -> Tuple [str , List [typing .Dict [str , Any ]]]:
188
+ ) -> Tuple [str , List [typing .Dict [str , Any ]], List [ typing . Dict [ str , Any ]] ]:
189
189
"""Table for all functions in the project. Contains many details about each
190
190
function"""
191
191
random_suffix = '_' + '' .join (
@@ -235,7 +235,8 @@ def create_all_function_table(
235
235
# an array in development to replace html generation in python.
236
236
# this will be stored as a json object and will be used to populate
237
237
# the table in the frontend
238
- table_rows = []
238
+ table_rows_json_html = []
239
+ table_rows_json_report = []
239
240
240
241
for fd_k , fd in proj_profile .all_functions .items ():
241
242
demangled_func_name = utils .demangle_cpp_func (fd .function_name )
@@ -286,7 +287,7 @@ def create_all_function_table(
286
287
else :
287
288
args_row = "0"
288
289
289
- table_rows .append ({
290
+ table_rows_json_html .append ({
290
291
"Func name" : func_name_row ,
291
292
"func_url" : func_cov_url ,
292
293
"Functions filename" : fd .function_source_file ,
@@ -304,8 +305,26 @@ def create_all_function_table(
304
305
"Accumulated cyclomatic complexity" : fd .total_cyclomatic_complexity ,
305
306
"Undiscovered complexity" : fd .new_unreached_complexity
306
307
})
308
+ table_rows_json_report .append ({
309
+ "Func name" : demangled_func_name ,
310
+ "func_url" : func_cov_url ,
311
+ "Functions filename" : fd .function_source_file ,
312
+ "Args" : str (fd .arg_types ),
313
+ "Function call depth" : fd .function_depth ,
314
+ "Reached by Fuzzers" : reached_by_fuzzers_row ,
315
+ "collapsible_id" : collapsible_id ,
316
+ "Fuzzers runtime hit" : func_hit_at_runtime_row ,
317
+ "Func lines hit %" : "%.5s" % (str (hit_percentage )) + "%" ,
318
+ "I Count" : fd .i_count ,
319
+ "BB Count" : fd .bb_count ,
320
+ "Cyclomatic complexity" : fd .cyclomatic_complexity ,
321
+ "Functions reached" : len (fd .functions_reached ),
322
+ "Reached by functions" : len (fd .incoming_references ),
323
+ "Accumulated cyclomatic complexity" : fd .total_cyclomatic_complexity ,
324
+ "Undiscovered complexity" : fd .new_unreached_complexity
325
+ })
307
326
html_string += ("</table>\n " )
308
- return html_string , table_rows
327
+ return html_string , table_rows_json_html , table_rows_json_report
309
328
310
329
311
330
def create_collapsible_element (
@@ -959,12 +978,20 @@ def create_html_report(
959
978
960
979
table_id = "fuzzers_overview_table"
961
980
tables .append (table_id )
962
- all_function_table , all_functions_json = create_all_function_table (
981
+ (all_function_table ,
982
+ all_functions_json_html ,
983
+ all_functions_json_report ) = create_all_function_table (
963
984
tables , proj_profile , coverage_url , basefolder , table_id )
964
985
html_report_core += all_function_table
965
986
html_report_core += "</div>" # .collapsible
966
987
html_report_core += "</div>" # report box
967
988
989
+ # Dump all functions in json report
990
+ json_report .add_project_key_value_to_report (
991
+ "all-functions" ,
992
+ all_functions_json_report
993
+ )
994
+
968
995
#############################################
969
996
# Section with details about each fuzzer, including calltree.
970
997
#############################################
@@ -1108,7 +1135,7 @@ def create_html_report(
1108
1135
# Write all functions to the .js file
1109
1136
with open (report_name , "a+" ) as all_funcs_json_file :
1110
1137
all_funcs_json_file .write ("var all_functions_table_data = " )
1111
- all_funcs_json_file .write (json .dumps (all_functions_json ))
1138
+ all_funcs_json_file .write (json .dumps (all_functions_json_html ))
1112
1139
1113
1140
# Remove existing fuzzer table data .js file
1114
1141
js_file = "fuzzer_table_data.js"
0 commit comments