Java: Add new quality query to detect empty methods#18947
Merged
tamasvajk merged 24 commits intogithub:mainfrom Mar 26, 2025
Merged
Java: Add new quality query to detect empty methods#18947tamasvajk merged 24 commits intogithub:mainfrom
tamasvajk merged 24 commits intogithub:mainfrom
Conversation
3976c8b to
bfff25a
Compare
tamasvajk
commented
Mar 11, 2025
jcogs33
reviewed
Mar 12, 2025
jcogs33
reviewed
Mar 13, 2025
jcogs33
reviewed
Mar 13, 2025
Co-authored-by: Jami <57204504+jcogs33@users.noreply.github.com>
Co-authored-by: Jami <57204504+jcogs33@users.noreply.github.com>
cd45d49 to
9662b47
Compare
jcogs33
reviewed
Mar 20, 2025
Contributor
jcogs33
left a comment
There was a problem hiding this comment.
A couple nits regarding the test cases (feel free to ignore). Otherwise looks ready for docs review to me (assuming we're doing docs reviews for these queries?).
Co-authored-by: Jami <57204504+jcogs33@users.noreply.github.com>
Contributor
|
I'll review this on behalf of Docs today. |
Contributor
|
How can I access a preview of the query help? (I know I can review the files in the diff but a preview would be super helpful). |
mchammer01
previously approved these changes
Mar 21, 2025
Contributor
mchammer01
left a comment
There was a problem hiding this comment.
@tamasvajk - Approving this on behalf of Docs ✨
I would begrateful if you could look at my comments/suggestions. Hope these are helpful 😃
Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com>
jcogs33
approved these changes
Mar 25, 2025
knewbury01
reviewed
Mar 25, 2025
Contributor
knewbury01
left a comment
There was a problem hiding this comment.
@tamasvajk @jcogs33 this all looks great to me!
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.
This query is migrated from the advance security team's quality queries.
The initial version was somewhat modified to report fewer alerts. The changes reduce the alert count in MRVA top 100 from 16800 to 4700.
I manually verified autofix suggestions. Most of them are single line additions to include a comment (
// intentionally left empty) in the empty method. Some of them have some reasoning why the method is empty, and I've also seen cases where the method was changed to beabstractor an exception was thrown.