Java: whitelist variable name tokenImage for java/sensitive-log as it's used in code generated by JavaCC#16028
Merged
owen-mc merged 5 commits intoMar 25, 2024
Conversation
smowton
reviewed
Mar 24, 2024
Co-authored-by: Chris Smowton <smowton@github.com>
9d43e78 to
ac6c4ad
Compare
Contributor
Author
|
I did an MRVA run on the top 1,000 java repos to see what results this PR was removing. There were 11 repos with results, including ones with 100, 314, 768 and 2,640 results. I checked the first result from each repo and confirmed it was due to code from JavaCC. So I think that confirms that they are all FPs and this PR is good to merge. It's also good to see that we are removing a source of FPs that can cause thousands of FPs in one repo. |
Contributor
|
That does sound like CodeQL would be borderline unusable for such people! |
smowton
approved these changes
Mar 25, 2024
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.
Note that the test imitates what is done in code generated by JavaCC.
I've whitelisted just exact matches to
tokenImage. A slightly broader approach might be to copy this line from the experimental queryjava/sensitive-query-with-getand whitelist all variable names starting withtoken.