Skip to content

Go: Update tags for high precision quality queries #19763

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 13, 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 some.

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.

@Copilot Copilot AI review requested due to automatic review settings June 13, 2025 16:01
@owen-mc owen-mc requested a review from a team as a code owner June 13, 2025 16:01
@github-actions github-actions bot added the Go label Jun 13, 2025
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 standardizes and expands the classification tags on Go QL queries for higher-precision code quality checks.

  • Adds or reorders tags (e.g., quality, reliability, correctness, useless-code, error-handling, readability) across multiple queries
  • Ensures each high-precision rule is properly classified under CWE and project-specific categories

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
go/ql/src/RedundantCode/SelfAssignment.ql Expanded tags to quality, reliability, and correctness
go/ql/src/RedundantCode/RedundantRecover.ql Replaced tags with quality, maintability, useless-code
go/ql/src/RedundantCode/RedundantExpr.ql Added quality and reliability tags
go/ql/src/RedundantCode/NegativeLengthCheck.ql Added quality, reliability, and correctness
go/ql/src/RedundantCode/ImpossibleInterfaceNilCheck.ql Added quality, reliability, correctness, CWE tag
go/ql/src/RedundantCode/ExprHasNoEffect.ql Replaced tags with quality, maintainability, useless-code
go/ql/src/RedundantCode/DuplicateSwitchCase.ql Changed maintainability to quality and added reliability
go/ql/src/RedundantCode/DuplicateCondition.ql Changed maintainability to quality and added reliability
go/ql/src/RedundantCode/DuplicateBranches.ql Changed maintainability to quality and added reliability
go/ql/src/RedundantCode/DeadStoreOfLocal.ql Replaced maintainability with quality and useless-code
go/ql/src/RedundantCode/DeadStoreOfField.ql Replaced maintainability with quality and useless-code
go/ql/src/RedundantCode/CompareIdenticalValues.ql Added quality and reliability tags
go/ql/src/InconsistentCode/WrappedErrorAlwaysNil.ql Replaced reliability with quality and reliability tags
go/ql/src/InconsistentCode/WhitespaceContradictsPrecedence.ql Replaced maintainability/correctness with quality and readability
go/ql/src/InconsistentCode/UnhandledCloseWritableHandle.ql Replaced multiple old tags with quality, reliability, error-handling
go/ql/src/InconsistentCode/MistypedExponentiation.ql Added quality, reliability, and correctness tags
go/ql/src/InconsistentCode/MissingErrorCheck.ql Replaced old tags with quality, reliability, error-handling
go/ql/src/InconsistentCode/LengthComparisonOffByOne.ql Replaced reliability with quality and reliability tags
go/ql/src/InconsistentCode/InconsistentLoopOrientation.ql Added quality, reliability, and correctness tags
go/ql/src/InconsistentCode/ConstantLengthComparison.ql Added quality, reliability, and correctness tags
Comments suppressed due to low confidence (2)

go/ql/src/InconsistentCode/WrappedErrorAlwaysNil.ql:7

  • This query detects an error-wrapping scenario; consider adding error-handling to its tags so that consumers can easily filter by error-related checks.
* @tags quality

go/ql/src/RedundantCode/DuplicateBranches.ql:7

  • The @id field appears after @precision here; swapping them (ID before precision) would align this file with the metadata order used elsewhere in the repo.
* @precision very-high

* @tags maintainability
* correctness
* quality
* @tags quality

This comment was marked as resolved.

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