In CodeChecker 6.23.0 when you analyze a file with an empty compilation database or the file to be analyzed is not found in the compilation database and therefore nothing is analyzed, CodeChecker returns with success.
This is not a good behaviour, because in fact nothing was analyzed which may not be what the user expected. So change the log level from info to warning for the following log events:
[INFO 2024-04-17 14:31] - No analysis is required. There were no compilation commands in the provided compilation database or all of them were skipped.
Reproduction:
Compilation db:
[{
"directory": "/workspace/sei_cert_test_suite/cpp",
"command": "/usr/bin/gcc -Itests -c tests/FLP37-C-A.c -o obj/FLP37-C-A.o",
"file": "tests/FLP37-C-A.c"
}]
CodeChecker analyze --output /local/workspace/sei_cert_test_suite/.codechecker/reports /local/workspace/sei_cert_test_suite/cpp/compile_commands.json --file /local/workspace/sei_cert_test_suite/cpp/tests/FLP37-C-A.c --analyzers clang-tidy clangsa -e cert
[INFO 2024-04-17 14:31] - No analysis is required.
There were no compilation commands in the provided compilation database or all of them were skipped.
The following behaviour is expected:
CodeChecker analyze --output /local/workspace/sei_cert_test_suite/.codechecker/reports /local/workspace/sei_cert_test_suite/cpp/compile_commands.json --file /local/workspace/sei_cert_test_suite/cpp/tests/FLP37-C-A.c --analyzers clang-tidy clangsa -e cert
[WARNING 2024-04-17 14:31] - No analysis is required.
[WARNING 2024-04-17 14:31] There were no compilation commands in the provided compilation database or all of them were skipped.
In CodeChecker 6.23.0 when you analyze a file with an empty compilation database or the file to be analyzed is not found in the compilation database and therefore nothing is analyzed, CodeChecker returns with success.
This is not a good behaviour, because in fact nothing was analyzed which may not be what the user expected. So change the log level from info to warning for the following log events:
[INFO 2024-04-17 14:31] - No analysis is required. There were no compilation commands in the provided compilation database or all of them were skipped.Reproduction:
Compilation db:
The following behaviour is expected: