Skip to content

the deprecated way to pass options to Analyzers seems to be non-working too #4492

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

Open
aag-norbert-lange opened this issue Mar 17, 2025 · 1 comment

Comments

@aag-norbert-lange
Copy link

Describe the bug

CodeChecker seems to ignore passing options to cppcheck the "old way".
I will find alot reports stating Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. despite adding this flag.

CodeChecker version


Kind | Version

Base package version | 6.25.0
Package build date | 2025-03-13T16:02
Git commit ID (hash) | 90df5ab
Git tag information | 6.25
Server supported Thrift API version | 6.61
Client Thrift API version | 6.61

To Reproduce
Steps to reproduce the behaviour:

  1. echo "--check-level=exhaustive" > /tmp/cppcheckargs.txt
  2. CodeChecker analyze --report-hash context-free-v2 --analyzers cppcheck --cppcheckargs /tmp/cppcheckargs.txt -i "${BUILD_TEMPDIR}"/_file.list -o "${BUILD_TEMPDIR}"/_plists "$BUILDDIR"/compile_commands.json

[WARNING 2025-03-17 16:29] - "--cppcheckargs" is deprecated. Use "--analyzer-config cppcheck:cc-verbatim-args-file=" instead.

Expected behaviour

cppcheck should use the flags from the file

Desktop (please complete the following information)

  • OS: Linux

(podman container)

Additional context

Note that before version 6.25 the only way to add the --check-level=exhaustive flag is via --cppcheckarg, and I have existing projects (and their branches) depend on it.
With Version 6.25 its now deprecated and not working, means updating CodeChecker alone will end up with tons of new reports.

@aag-norbert-lange
Copy link
Author

aag-norbert-lange commented Apr 8, 2025

The bug is at analyzer/codechecker_analyzer/cli/analyze.py:1102

it should be cppcheck instead of clang-tidy: f'clang-tidy:cc-verbatim-args-file={args.cppcheck_args_cfg_file}'))

I did change the following bit in the release-v6.25 branch and this solved the issue for me (apart from #4498 requiring another hack):

--- a/analyzer/codechecker_analyzer/cmd/analyze.py
+++ b/analyzer/codechecker_analyzer/cmd/analyze.py
@@ -1102,7 +1102,7 @@ def __transform_deprecated_flags(args):
             'clang-tidy:cc-verbatim-args-file=<filepath>" instead.')
     if hasattr(args, 'cppcheck_args_cfg_file'):
         args.analyzer_config.append(analyzer_config(
-            f'clang-tidy:cc-verbatim-args-file={args.cppcheck_args_cfg_file}'))
+            f'cppcheck:cc-verbatim-args-file={args.cppcheck_args_cfg_file}'))
         delattr(args, 'cppcheck_args_cfg_file')
         LOG.warning(
             '"--cppcheckargs" is deprecated. Use "--analyzer-config '
-- 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant