From 3d091f5da3cc2158407457f579b4763830b14e93 Mon Sep 17 00:00:00 2001 From: Dmitry Maryushkin Date: Wed, 16 Oct 2024 21:58:33 +0300 Subject: [PATCH] Refactor mobsf parser for v4 reports --- dojo/tools/mobsf/parser.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dojo/tools/mobsf/parser.py b/dojo/tools/mobsf/parser.py index a6084a2a54..914fa02034 100644 --- a/dojo/tools/mobsf/parser.py +++ b/dojo/tools/mobsf/parser.py @@ -52,14 +52,14 @@ def get_findings(self, filename, test): field_value = str(data.get("appsec", {}).get(field, "")) if field_value: - test_description = "{0} **{1}:** {2}\n".format(test_description, field, field_value) + test_description = f"{test_description} **{field}:** {field_value}\n" for field in main_fields_for_test_desc: field_value = str(data.get(field, "")) if field_value: - test_description = "{0} **{1}:** {2}\n".format(test_description, field, field_value) + test_description = f"{test_description} **{field}:** {field_value}\n" test.description = test_description @@ -81,13 +81,13 @@ def get_findings(self, filename, test): title = str(mobsf_finding.get("title", "")) description = str(mobsf_finding.get("description", "")) - unique_key = "{0} - {1} - {2} - {3}".format(finding_severity, section, title, description) + unique_key = f"{finding_severity}-{section}-{title}-{description}" finding = Finding( title=title, cwe=919, # Weaknesses in Mobile Applications test=test, - description="**Category:** {0}\n\n{1}".format(section, description), + description=f"**Category:** {section}\n\n{description}", severity=finding_severities[finding_severity], references=None, date=find_date,