Skip to content

Java: Tag quality queries with quality and sub-category #19799

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

owen-mc
Copy link
Contributor

@owen-mc owen-mc commented Jun 17, 2025

Updated tags for high and very high precision quality queries, using the query metadata guide. It is intended that all of these queries will now be in the quality suite.

I used copilot to do most of these, though I did review them all and change many of them.

Something that came up several times is a query that finds what is probably a coding mistake which leads to dead code. I erred on the side of tagging these as correctness (or sometimes error-handling) rather than useless-code, as the more serious issue is that the code probably contains a correctness error, rather than that there is some useless code that should be deleted.

The existing efficiency and logic tags seem to be superseded by the new performance and correctness sub-categories, but I will leave removing them for another PR so as not to delay this one.

@Copilot Copilot AI review requested due to automatic review settings June 17, 2025 14:24
@owen-mc owen-mc requested a review from a team as a code owner June 17, 2025 14:24
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds the new quality top-level tag and appropriate sub-category tags (e.g., reliability, correctness, performance, etc.) to Java CodeQL queries, replacing legacy maintainability, reliability, and efficiency tags for consistency. It also updates the change notes to document these metadata changes. Removal of all legacy tags is deferred to a future PR.

Reviewed Changes

Copilot reviewed 80 out of 80 changed files in this pull request and generated no comments.

File Description
java/ql/src/change-notes/2025-06-17-add-tags-to-quality-queries.md Updated bullets to describe added/removed tags
java/ql/src/Violations of Best Practice/Undesirable Calls/PrintLnArray.ql Replaced maintainability with quality + reliability + correctness tags
java/ql/src/Violations of Best Practice/Undesirable Calls/DefaultToString.ql Replaced reliability + maintainability with quality + reliability + correctness tags
Comments suppressed due to low confidence (3)

java/ql/src/change-notes/2025-06-17-add-tags-to-quality-queries.md:6

  • Remove the trailing "and ." and ensure the list of queries is complete.
* The tag `readability` has been added to `java/missing-override-annotation`, `java/deprecated-call`, `java/inconsistent-javadoc-throws`, `java/unknown-javadoc-parameter`, `java/jdk-internal-api-access`, `java/underscore-identifier`, `java/misleading-indentation`, `java/constants-only-interface` and .

java/ql/src/Violations of Best Practice/Undesirable Calls/PrintLnArray.ql:10

  • java/print-array should not include the reliability tag per the change notes, so remove this line.
 *       reliability

java/ql/src/Violations of Best Practice/Undesirable Calls/DefaultToString.ql:10

  • java/call-to-object-tostring should not include the reliability tag per the change notes, so remove this line.
 *       reliability

@owen-mc owen-mc requested a review from aschackmull June 17, 2025 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant