Improvements#101
Merged
Merged
Conversation
Add _preceded_by_member_or_namespace() which checks the characters immediately before a matched word. If the word follows '.' or '->', it is a method call on an object rather than the dangerous global C function, and the hit is suppressed. Namespace-qualified calls (ns::func()) are intentionally NOT suppressed: some are flagged by design (e.g. std::equal with three iterators), so that distinction requires per-rule knowledge and is deferred. Only horizontal whitespace (space, tab) is skipped in the backward scan; newlines are treated as boundaries to avoid crossing into preceding comment text and finding false alphanumeric matches. Adds test_013 (test-member-calls.cpp) covering: - obj.read() and ptr->read() produce no hit - bare read() and ::system() still produce hits Fixes: #83, #59 (and partially #82) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previously a UnicodeDecodeError in any file would immediately abort the entire scan (sys.exit(15)), preventing CI/CD pipelines from seeing results for all other files. New behaviour: - Print the full advisory (PYTHONUTF8, LC_ALL, iconv options) and skip the offending file; scanning continues on remaining files. - Track skipped files in num_encoding_errors and report the count in the summary alongside num_links_skipped etc. - Always exit with code 15 if any encoding errors were encountered, so CI/CD pipelines see a non-zero exit and are alerted. Fixes: #80, #68 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Percent-encode file paths in _to_uri_path so filenames with spaces or special characters produce valid URIs accepted by GitHub's SARIF upload API. Simplify helpuri to use re.search for reliable CWE extraction instead of the fragile split-and-append approach. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Allows users to skip third-party libraries, generated code, or test directories using repeatable --exclude flags backed by fnmatch full-path matching (e.g. --exclude '*/third_party/*'). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
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.
No description provided.