Skip to content

Commit

Permalink
Add files list in scorecard desc (#2473)
Browse files Browse the repository at this point in the history
* Add files list in scorecard desc
* fix lint

---------

Co-authored-by: Dmitry Maryushkin <[email protected]>
Co-authored-by: Ajin Abraham <[email protected]>
  • Loading branch information
3 people authored Dec 18, 2024
1 parent 17332e8 commit 180de6b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion mobsf/StaticAnalyzer/views/common/appsec.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,20 @@ def common_fields(findings, data):
sev = cd['metadata']['severity']
desc = cd['metadata']['description']
ref = cd['metadata'].get('ref', '')

files_dict = cd.get('files', {})
files_lines = [f'{file}, line(s) {lines}'
for file, lines in files_dict.items()]
all_files_str = '\n'.join(files_lines)

if files_dict:
fdesc = f'{desc}\n{ref}\n\nFiles:\n{all_files_str}'
else:
fdesc = f'{desc}\n{ref}'

findings[sev].append({
'title': cd['metadata']['description'],
'description': f'{desc}\n{ref}',
'description': fdesc,
'section': 'code',
})
# Permissions
Expand Down

0 comments on commit 180de6b

Please sign in to comment.