Skip to content

Commit f11f4d0

Browse files
💄 beautify multiple file format choices (#12117)
* 💄 beautify tenable file format choice * update
1 parent f0ea0dd commit f11f4d0

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

dojo/tools/tenable/parser.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ def get_description_for_scan_types(self, scan_type):
1515
)
1616

1717
def get_findings(self, filename, test):
18-
if filename.name.lower().endswith(
19-
".xml",
20-
) or filename.name.lower().endswith(".nessus"):
18+
if filename.name.lower().endswith((".xml", ".nessus")):
2119
return TenableXMLParser().get_findings(filename, test)
2220
if filename.name.lower().endswith(".csv"):
2321
return TenableCSVParser().get_findings(filename, test)

dojo/tools/veracode/json_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def add_sca_details(self, finding, finding_details, backup_title=None) -> Findin
276276
# Check for any wonky formats post version replacement that had extensions
277277
finding.component_name = finding.component_name.replace("-.", ".").replace("_.", ".")
278278
# Check for the event that the component name did not have an extension, but name has a dangling hyphen/underscore
279-
if finding.component_name.endswith("-") or finding.component_name.endswith("_"):
279+
if finding.component_name.endswith(("-", "_")):
280280
finding.component_name = finding.component_name[:-1]
281281
# check if the CWE title was used. A cwe may not be present when a veracode SRCCLR is present
282282
if not finding.title:

0 commit comments

Comments
 (0)