Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
Szelethus committed Oct 4, 2023
1 parent 7604403 commit cd865c6
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 31 deletions.
7 changes: 4 additions & 3 deletions analyzer/codechecker_analyzer/analyzers/gcc/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,9 @@ def __get_analyzer_version(cls, analyzer_binary, env):
version = [analyzer_binary, '-dumpfullversion']
try:
output = subprocess.check_output(version,
encoding="utf-8",
errors="ignore")
env=env,
encoding="utf-8",
errors="ignore")
return output
except (subprocess.CalledProcessError, OSError) as oerr:
LOG.warning("Failed to get analyzer version: %s",
Expand Down Expand Up @@ -234,7 +235,7 @@ def construct_config_handler(cls, args):

handler.analyzer_config = analyzer_config

check_env = context.analyzer_env
# check_env = context.analyzer_env

# # Overwrite PATH to contain only the parent of the cppcheck binary.
# if os.path.isabs(Gcc.analyzer_binary()):
Expand Down
11 changes: 5 additions & 6 deletions analyzer/codechecker_analyzer/analyzers/gcc/result_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +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 BugPathEvent, \
Range, report_file
from codechecker_report_converter.report import report_file
from codechecker_report_converter.report.hash import get_report_hash, HashType

from codechecker_common.logger import get_logger
Expand Down Expand Up @@ -58,10 +57,10 @@ def postprocess_result(self, skip_handlers: Optional[SkipListHandlers]):
source_dir_path=self.source_dir_path)

reports = [r for r in reports if not r.skip(skip_handlers)]
#for report in reports:
# # TODO check if prefix cascading still occurs.
# if not report.checker_name.startswith("gcc-"):
# report.checker_name = "gcc-" + report.checker_name
# for report in reports:
# # TODO check if prefix cascading still occurs.
# if not report.checker_name.startswith("gcc-"):
# report.checker_name = "gcc-" + report.checker_name

hash_type = HashType.PATH_SENSITIVE
if self.report_hash_type == 'context-free-v2':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def teardown_class(cls):
global TEST_WORKSPACE

print("Removing: " + TEST_WORKSPACE)
#shutil.rmtree(TEST_WORKSPACE)
shutil.rmtree(TEST_WORKSPACE)

def teardown_method(self, method):
"""Restore environment after a particular test has run."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,48 +18,40 @@ CHECK#CodeChecker check --build "make gcc_simple" --output $OUTPUT$ --quiet --an
[] - To store results use the "CodeChecker store" command.
[] - See --help and the user guide for further options about parsing and storing the reports.
[] - ----=================----
[UNSPECIFIED] gcc_simple.cpp:5:3: double-‘free’ of ‘i’ [gcc--Wanalyzer-double-free]
free(i);
^

Found 1 defect(s) in gcc_simple.cpp

[None] gcc_simple.cpp:5:3: double-‘free’ of ‘i’ [-Wanalyzer-double-free]
[LOW] gcc_simple.cpp:5:3: double-‘free’ of ‘i’ [-Wanalyzer-double-free]
free(i);
^

Found 1 defect(s) in gcc_simple.cpp


----==== Severity Statistics ====----
-------------------------------
Severity | Number of reports
-------------------------------
UNSPECIFIED | 1
| 1
-------------------------------
----------------------------
Severity | Number of reports
----------------------------
LOW | 1
----------------------------
----=================----

----==== Checker Statistics ====----
------------------------------------------------------------
Checker name | Severity | Number of reports
------------------------------------------------------------
gcc--Wanalyzer-double-free | UNSPECIFIED | 1
-Wanalyzer-double-free | | 1
------------------------------------------------------------
-----------------------------------------------------
Checker name | Severity | Number of reports
-----------------------------------------------------
-Wanalyzer-double-free | LOW | 1
-----------------------------------------------------
----=================----

----==== File Statistics ====----
----------------------------------
File name | Number of reports
----------------------------------
gcc_simple.cpp | 2
gcc_simple.cpp | 1
----------------------------------
----=================----

----======== Summary ========----
---------------------------------------------
Number of processed analyzer result files | 2
Number of analyzer reports | 2
Number of analyzer reports | 1
---------------------------------------------
----=================----

0 comments on commit cd865c6

Please sign in to comment.