Skip to content

Conversation

@vkucera
Copy link
Collaborator

@vkucera vkucera commented Sep 23, 2025

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

@github-actions
Copy link

github-actions bot commented Sep 23, 2025

O2 linter results: ❌ 0 errors, ⚠️ 0 warnings, 🔕 0 disabled

@github-actions github-actions bot changed the title Unlock the power of cppcheck [Infrastructure] Unlock the power of cppcheck Sep 23, 2025
@victor-gonzalez
Copy link
Collaborator

Wow!!!
Can we check the code locally?

@vkucera
Copy link
Collaborator Author

vkucera commented Sep 23, 2025

Wow!!! Can we check the code locally?

Yes, if you have cppcheck installed. I am preparing instructions in the Tools section of docs.

@vkucera vkucera marked this pull request as ready for review September 23, 2025 11:15
@victor-gonzalez
Copy link
Collaborator

Wow!!! Can we check the code locally?

Yes, if you have cppcheck installed. I am preparing instructions in the Tools section of docs.

Great!!!
Thanks!!

@vkucera vkucera marked this pull request as draft September 23, 2025 12:49
@vkucera vkucera marked this pull request as ready for review September 23, 2025 14:40
@vkucera vkucera marked this pull request as draft October 6, 2025 10:30
@vkucera
Copy link
Collaborator Author

vkucera commented Oct 6, 2025

Pending discussion on the list of enabled error categories.
In the meantime, the other configuration changes can be merged. #13247

@github-actions
Copy link

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.

@github-actions github-actions bot added the stale label Nov 18, 2025
@vkucera vkucera removed the stale label Nov 18, 2025
@github-actions
Copy link

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.

@github-actions github-actions bot added the stale label Dec 19, 2025
@vkucera vkucera removed the stale label Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants