diff --git a/dojo/tools/intsights/parser.py b/dojo/tools/intsights/parser.py index 3e6219a466..91724c92c5 100644 --- a/dojo/tools/intsights/parser.py +++ b/dojo/tools/intsights/parser.py @@ -23,6 +23,7 @@ def get_description_for_scan_types(self, scan_type): def _build_finding_description(self, alert: dict) -> str: """ Builds an IntSights Finding description from various pieces of information. + Args: alert: The parsed alert dictionary Returns: A markdown formatted description diff --git a/dojo/tools/qualys/csv_parser.py b/dojo/tools/qualys/csv_parser.py index 46e49eaedb..e68b8b1778 100644 --- a/dojo/tools/qualys/csv_parser.py +++ b/dojo/tools/qualys/csv_parser.py @@ -33,6 +33,7 @@ def parse_csv(csv_file) -> [Finding]: def get_report_findings(csv_reader) -> [dict]: """ Filters out the unneeded information at the beginning of the Qualys CSV report. + Args: csv_reader: @@ -55,6 +56,7 @@ def _extract_cvss_vectors(cvss_base, cvss_temporal): This is done because the raw values come with additional characters that cannot be parsed with the cvss library. Example: 6.7 (AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H) + Args: cvss_base: cvss_temporal: diff --git a/dojo/tools/whitehat_sentinel/parser.py b/dojo/tools/whitehat_sentinel/parser.py index c23d002cb8..eabe10db22 100644 --- a/dojo/tools/whitehat_sentinel/parser.py +++ b/dojo/tools/whitehat_sentinel/parser.py @@ -57,6 +57,7 @@ def _convert_whitehat_severity_id_to_dojo_severity( ) -> str | None: """ Converts a WhiteHat Sentinel numerical severity to a DefectDojo severity. + Args: whitehat_severity_id: The WhiteHat Severity ID (called risk_id in the API) Returns: A DefectDojo severity if a mapping can be found; otherwise a null value is returned @@ -79,6 +80,7 @@ def _convert_whitehat_severity_id_to_dojo_severity( def _parse_cwe_from_tags(self, whitehat_sentinel_tags) -> str: """ Some Vulns include the CWE ID as a tag. This is used to pull it out of that list and return only the ID. + Args: whitehat_sentinel_tags: The Tags list from the WhiteHat vuln Returns: The first CWE ID in the list, if it exists @@ -91,6 +93,7 @@ def _parse_cwe_from_tags(self, whitehat_sentinel_tags) -> str: def _parse_description(self, whitehat_sentinel_description: dict): """ Manually converts the HTML description to a DefectDojo-friendly format. + Args: whitehat_sentinel_description: The description section of the WhiteHat Sentinel vulnerability dict Returns: A dict with description and reference link @@ -144,6 +147,7 @@ def _parse_solution(self, whitehat_sentinel_vuln_solution): def __get_href_url(self, text_to_search): """ Searches for the anchor targets within a string that includes an anchor tag. + Args: text_to_search: The text string to search for an anchor tag Returns: @@ -157,6 +161,7 @@ def __get_href_url(self, text_to_search): def __remove_paragraph_tags(self, html_string): """ Manually remove

tags from HTML strings to avoid importing yet-another-library. + Args: html_string: The HMTL string to remove

tags from Returns: The original string stipped of paragraph tags diff --git a/ruff.toml b/ruff.toml index 649b03a036..0d5dadf4af 100644 --- a/ruff.toml +++ b/ruff.toml @@ -37,7 +37,7 @@ select = [ "W", "C90", "I", - "D2", "D3", "D403", + "D2", "D3", "D403", "D411", "UP", "YTT", "ASYNC",