-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Java: Add new quality query to detect empty methods #18947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java: Add new quality query to detect empty methods #18947
Conversation
3976c8b to
bfff25a
Compare
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
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
|
I'll review this on behalf of Docs today. |
|
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
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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>
knewbury01
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tamasvajk @jcogs33 this all looks great to me!
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.