mirror of
https://github.com/hohn/sarif-cli.git
synced 2025-12-16 17:23:03 +01:00
sarif-to-dot: add more support for --fill-structure option
Expand
('Struct4827', ('struct', ('physicalLocation', 'Struct4963'))),
to have fields
( 'Struct2683',
( 'struct',
('id', 'Int'),
('message', 'Struct2774'),
('physicalLocation', 'Struct4963')))
and avoid a redundant table.
This commit is contained in:
committed by
=Michael Hohn
parent
eb53ede8b1
commit
119f9a5c18
@@ -227,6 +227,8 @@ dummy_relatedLocations_entry = [
|
||||
'endColumn': -1}},
|
||||
'message': {'text': ''}}]
|
||||
|
||||
dummy_message_entry = {'text': ''}
|
||||
|
||||
def fillsig_dict(args, elem, context):
|
||||
""" Fill in the missing fields in dictionary signatures.
|
||||
"""
|
||||
@@ -265,6 +267,11 @@ def fillsig_dict(args, elem, context):
|
||||
full_elem['relatedLocations'] = elem.get('relatedLocations',
|
||||
dummy_relatedLocations_entry)
|
||||
_remaining_keys()
|
||||
elif 'physicalLocation' in elem.keys():
|
||||
# Ensure id and message are present
|
||||
full_elem['id'] = elem.get('id', -1)
|
||||
full_elem['message'] = elem.get('message', dummy_message_entry)
|
||||
_remaining_keys()
|
||||
else:
|
||||
full_elem = elem
|
||||
|
||||
|
||||
Reference in New Issue
Block a user