-
Notifications
You must be signed in to change notification settings - Fork 613
[Infrastructure] Unlock the power of cppcheck #13097
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
base: master
Are you sure you want to change the base?
Conversation
|
O2 linter results: ❌ 0 errors, |
|
Wow!!! |
Yes, if you have cppcheck installed. I am preparing instructions in the Tools section of docs. |
Great!!! |
|
Pending discussion on the list of enabled error categories. |
|
This PR has not been updated in the last 30 days. Is it still needed? Unless further action is taken, it will be closed in 5 days. |
|
This PR has not been updated in the last 30 days. Is it still needed? Unless further action is taken, it will be closed in 5 days. |
In the default configuration, cppcheck (which runs as one of the MegaLinter PR checks) only reports the most critical bugs, such as out of bound access, memory leaks, null pointer dereferences and uninitialised data members. The current codebase has around 90 such reported bugs.
With all checks enabled, cppcheck finds significantly more bugs, potential bugs (such as useless, duplicated, nonsensical, or unreachable code), inefficient code, and many other issues that would otherwise be considered compilation warnings if found by the compiler.
With this configuration, cppcheck has found over 4000 issues in the current codebase among which hundreds are genuine bugs, other hundreds are suspicious constructs (which are likely bugs too), and hundreds more are inefficient constructs.
Despite the high number of true positives the number of false positives stays very low.
EDIT: Instructions for local execution here: AliceO2Group/analysis-framework#313