From 6b248d247489339d3468ce43ee1601f82551a947 Mon Sep 17 00:00:00 2001 From: Kristen Newbury Date: Fri, 2 Jun 2023 16:22:18 -0400 Subject: [PATCH] Add missing columns to column order list prev missing cols: source_location and sink_location missing from prev patch but were missing in problem only results case anyways --- sarif_cli/columns.py | 5 ++++- sarif_cli/scan_tables.py | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sarif_cli/columns.py b/sarif_cli/columns.py index 76634c3..71d8dda 100644 --- a/sarif_cli/columns.py +++ b/sarif_cli/columns.py @@ -26,6 +26,7 @@ columns = { 'message' , 'message_object' , 'location' , + 'source_startLine', 'source_startCol', 'source_endLine' , @@ -35,7 +36,9 @@ columns = { 'sink_endLine' , 'sink_endCol' , 'source_object' , - 'sink_object' + 'sink_object', + 'source_location', + 'sink_location' ], "projects" : [ "id" , diff --git a/sarif_cli/scan_tables.py b/sarif_cli/scan_tables.py index 3d56e12..0613d82 100644 --- a/sarif_cli/scan_tables.py +++ b/sarif_cli/scan_tables.py @@ -47,11 +47,13 @@ class ScanTablesTypes: 'message_object' : numpy.dtype('O'), 'location' : pd.StringDtype(), + 'source_location' : pd.StringDtype(), 'source_startLine' : pd.Int64Dtype(), 'source_startCol' : pd.Int64Dtype(), 'source_endLine' : pd.Int64Dtype(), 'source_endCol' : pd.Int64Dtype(), + 'sink_location' : pd.StringDtype(), 'sink_startLine' : pd.Int64Dtype(), 'sink_startCol' : pd.Int64Dtype(), 'sink_endLine' : pd.Int64Dtype(), @@ -213,11 +215,13 @@ def _results_from_kind_problem(basetables, external_info): 'location': b.kind_problem.location_uri, # for kind_problem, use the same location for source and sink + 'source_location' : pd.NA, 'source_startLine' : b.kind_problem.location_startLine, 'source_startCol' : b.kind_problem.location_startColumn, 'source_endLine' : b.kind_problem.location_endLine, 'source_endCol' : b.kind_problem.location_endColumn, + 'sink_location' : pd.NA, 'sink_startLine' : b.kind_problem.location_startLine, 'sink_startCol' : b.kind_problem.location_startColumn, 'sink_endLine' : b.kind_problem.location_endLine,