fix(cxx): cppcheck include-path harvesting and information-record classification - #723
Open
karabelaselias wants to merge 1 commit into
Conversation
…fy cppcheck information records Two root causes produced unactionable cppcheck findings on C++ projects whose sources include headers outside the scanned tree (vendored or sibling-package code): 1. _cppcheck_include_args derived -I dirs only from in-scope headers, so external include roots (recorded in the project's own compile_commands.json) were never passed to cppcheck and every external header produced missingInclude records. Harvest -I paths from compile_commands.json entries matching the scanned files, falling back gracefully when the database is absent or malformed. 2. cppcheck's information category (missing include paths, checker reports, normalization notes) is non-actionable by definition but was captured as findings. Classify information-severity records as non-actionable in the phase filter. Verified against a C++17 rod-solver repo (114 files) where 47 information-level records and repeated missingInclude noise dissolved after the fix; upstream test suite green (5818 passed, 3 skipped) with new unit tests for the classifier, compile-db harvesting, and malformed database handling.
citizenadam
added a commit
to citizenadam/desloppify
that referenced
this pull request
Sep 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On C++ projects whose sources include headers outside the scanned tree (vendored or sibling-package code), the cppcheck phase produced unactionable findings:
_cppcheck_include_argsderived-Idirs only from in-scope headers, so external include roots recorded in the project's owncompile_commands.jsonwere never passed to cppcheck — every external header emittedmissingIncluderecords.informationcategory (missing include paths, checker reports, normalization notes) is non-actionable by definition but was captured as findings.Fix
-Ipaths fromcompile_commands.jsonentries matching the scanned files, falling back gracefully when the database is absent or malformed.information-severity records as non-actionable in the phase filter.Verification