From d93d6bca4115a2b935e20c8f019bcc36be081a07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Umann?= Date: Thu, 2 Nov 2023 09:27:39 +0100 Subject: [PATCH] Not all dots are stripped --- .../analyzers/gcc/result_handler.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/analyzer/codechecker_analyzer/analyzers/gcc/result_handler.py b/analyzer/codechecker_analyzer/analyzers/gcc/result_handler.py index 8040d3b7ff..da929dc290 100644 --- a/analyzer/codechecker_analyzer/analyzers/gcc/result_handler.py +++ b/analyzer/codechecker_analyzer/analyzers/gcc/result_handler.py @@ -16,7 +16,7 @@ from codechecker_report_converter.report.parser.base import AnalyzerInfo from codechecker_report_converter.analyzers.gcc.analyzer_result import \ AnalyzerResult -from codechecker_report_converter.report import report_file +from codechecker_report_converter.report import Report, report_file from codechecker_report_converter.report.hash import get_report_hash, HashType from codechecker_common.logger import get_logger @@ -42,6 +42,14 @@ def codechecker_name_to_actual_name_disabled(codechecker_name: str): return codechecker_name.replace("gcc", "-Wno-analyzer") +def prune_unnecessary_events(report: Report): + for event in report.bug_path_events: + if event.message == "...to here": + report.bug_path_events.remove(event) + else: + event.message = event.message.strip(".") + + class GccResultHandler(ResultHandler): """ Create analyzer result file for Gcc output. @@ -73,6 +81,7 @@ def postprocess_result(self, skip_handlers: Optional[SkipListHandlers]): reports = [r for r in reports if not r.skip(skip_handlers)] for report in reports: + prune_unnecessary_events(report) report.checker_name = \ actual_name_to_codechecker_name(report.checker_name)