Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 MicroFocus WebInspect: Add better error handling #9327

Merged
merged 1 commit into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions dojo/tools/microfocus_webinspect/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,13 @@ def get_findings(self, file, test):
cwe = 0
description = ""
classifications = issue.find("Classifications")
for content in classifications.findall("Classification"):
# detect CWE number
# TODO support more than one CWE number
if (
"kind" in content.attrib
and "CWE" == content.attrib["kind"]
):
cwe = MicrofocusWebinspectParser.get_cwe(
content.attrib["identifier"]
)
description += "\n\n" + content.text + "\n"
if classifications is not None:
for content in classifications.findall('Classification'):
# detect CWE number
# TODO support more than one CWE number
if "kind" in content.attrib and "CWE" == content.attrib["kind"]:
cwe = MicrofocusWebinspectParser.get_cwe(content.attrib['identifier'])
description += "\n\n" + content.text + "\n"

finding = Finding(
title=issue.findtext("Name"),
Expand Down Expand Up @@ -114,6 +110,8 @@ def convert_severity(val):
return "Medium"
elif val == "3":
return "High"
elif val == "4":
return "Critical"
else:
return "Info"

Expand Down
Loading