-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,22 @@ | ||
ql/go/ql/src/InconsistentCode/ConstantLengthComparison.ql | ||
ql/go/ql/src/InconsistentCode/InconsistentLoopOrientation.ql | ||
ql/go/ql/src/InconsistentCode/LengthComparisonOffByOne.ql | ||
ql/go/ql/src/InconsistentCode/MissingErrorCheck.ql | ||
ql/go/ql/src/InconsistentCode/MistypedExponentiation.ql | ||
ql/go/ql/src/InconsistentCode/UnhandledCloseWritableHandle.ql | ||
ql/go/ql/src/InconsistentCode/WhitespaceContradictsPrecedence.ql | ||
ql/go/ql/src/InconsistentCode/WrappedErrorAlwaysNil.ql | ||
ql/go/ql/src/RedundantCode/CompareIdenticalValues.ql | ||
ql/go/ql/src/RedundantCode/DeadStoreOfField.ql | ||
ql/go/ql/src/RedundantCode/DeadStoreOfLocal.ql | ||
ql/go/ql/src/RedundantCode/DuplicateBranches.ql | ||
ql/go/ql/src/RedundantCode/DuplicateCondition.ql | ||
ql/go/ql/src/RedundantCode/DuplicateSwitchCase.ql | ||
ql/go/ql/src/RedundantCode/ExprHasNoEffect.ql | ||
ql/go/ql/src/RedundantCode/ImpossibleInterfaceNilCheck.ql | ||
ql/go/ql/src/RedundantCode/NegativeLengthCheck.ql | ||
ql/go/ql/src/RedundantCode/RedundantExpr.ql | ||
ql/go/ql/src/RedundantCode/RedundantRecover.ql | ||
ql/go/ql/src/RedundantCode/SelfAssignment.ql | ||
ql/go/ql/src/RedundantCode/ShiftOutOfRange.ql | ||
ql/go/ql/src/RedundantCode/UnreachableStatement.ql |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,22 @@ | ||
ql/go/ql/src/InconsistentCode/ConstantLengthComparison.ql | ||
ql/go/ql/src/InconsistentCode/InconsistentLoopOrientation.ql | ||
ql/go/ql/src/InconsistentCode/LengthComparisonOffByOne.ql | ||
ql/go/ql/src/InconsistentCode/MissingErrorCheck.ql | ||
ql/go/ql/src/InconsistentCode/MistypedExponentiation.ql | ||
ql/go/ql/src/InconsistentCode/UnhandledCloseWritableHandle.ql | ||
ql/go/ql/src/InconsistentCode/WhitespaceContradictsPrecedence.ql | ||
ql/go/ql/src/InconsistentCode/WrappedErrorAlwaysNil.ql | ||
ql/go/ql/src/RedundantCode/CompareIdenticalValues.ql | ||
ql/go/ql/src/RedundantCode/DeadStoreOfField.ql | ||
ql/go/ql/src/RedundantCode/DeadStoreOfLocal.ql | ||
ql/go/ql/src/RedundantCode/DuplicateBranches.ql | ||
ql/go/ql/src/RedundantCode/DuplicateCondition.ql | ||
ql/go/ql/src/RedundantCode/DuplicateSwitchCase.ql | ||
ql/go/ql/src/RedundantCode/ExprHasNoEffect.ql | ||
ql/go/ql/src/RedundantCode/ImpossibleInterfaceNilCheck.ql | ||
ql/go/ql/src/RedundantCode/NegativeLengthCheck.ql | ||
ql/go/ql/src/RedundantCode/RedundantExpr.ql | ||
ql/go/ql/src/RedundantCode/RedundantRecover.ql | ||
ql/go/ql/src/RedundantCode/SelfAssignment.ql | ||
ql/go/ql/src/RedundantCode/ShiftOutOfRange.ql | ||
ql/go/ql/src/RedundantCode/UnreachableStatement.ql |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,9 @@ | |
* @kind problem | ||
* @problem.severity warning | ||
* @id go/redundant-assignment | ||
* @tags correctness | ||
* @tags quality | ||
* reliability | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't this more in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It depends. I compared the qhelp for the equivalent query for a few languages and some took the "this line does nothing, just delete it" approach, and others took the "this is probably a sign that you meant to write something else, there's probably a bug" approach. We should be consistent, I suppose. I'll raise it with the team. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @owen-mc I think that explanation makes sense with regards to what finding a self-assignment in the code might mean. That said, wouldn't There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is fine to keep it as it is - let's merge 😄 . |
||
* correctness | ||
* external/cwe/cwe-480 | ||
* external/cwe/cwe-561 | ||
* @precision high | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
category: queryMetadata | ||
--- | ||
* The tag `quality` has been added to multiple Go quality queries for consistency. They have all been given a tag for one of the two top-level categories `reliability` or `maintainability`, and a tag for a sub-category. See [Query file metadata and alert message style guide](https://github.com/github/codeql/blob/main/docs/query-metadata-style-guide.md#quality-query-sub-category-tags) for more information about these categories. | ||
michaelnebel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* The tag `external/cwe/cwe-129` has been added to `go/constant-length-comparison`. | ||
* The tag `external/cwe/cwe-193` has been added to `go/index-out-of-bounds`. | ||
* The tag `external/cwe/cwe-197` has been added to `go/shift-out-of-range`. | ||
* The tag `external/cwe/cwe-248` has been added to `go/redundant-recover`. | ||
* The tag `external/cwe/cwe-252` has been added to `go/missing-error-check` and `go/unhandled-writable-file-close`. | ||
* The tag `external/cwe/cwe-480` has been added to `go/mistyped-exponentiation`. | ||
* The tag `external/cwe/cwe-570` has been added to `go/impossible-interface-nil-check` and `go/comparison-of-identical-expressions`. | ||
* The tag `external/cwe/cwe-571` has been added to `go/negative-length-check` and `go/comparison-of-identical-expressions`. | ||
* The tag `external/cwe/cwe-783` has been added to `go/whitespace-contradicts-precedence`. | ||
* The tag `external/cwe/cwe-835` has been added to `go/inconsistent-loop-direction`. | ||
* The tag `error-handling` has been added to `go/missing-error-check`, `go/unhandled-writable-file-close`, and `go/unexpected-nil-value`. | ||
* The tag `useless-code` has been added to `go/useless-assignment-to-field`, `go/useless-assignment-to-local`, `go/useless-expression`, and `go/unreachable-statement`. | ||
* The tag `logic` has been removed from `go/index-out-of-bounds` and `go/unexpected-nil-value`. | ||
* The tags `call` and `defer` have been removed from `go/unhandled-writable-file-close`. | ||
* The tags `correctness` and `quality` have been reordered in `go/missing-error-check` and `go/unhandled-writable-file-close`. | ||
* The tag `maintainability` has been changed to `reliability` for `go/unhandled-writable-file-close`. | ||
* The tag order has been standardized to have `quality` first, followed by the top-level category (`reliability` or `maintainability`), then sub-category tags, and finally CWE tags. | ||
* The description text has been updated in `go/whitespace-contradicts-precedence` to change "may even indicate" to "may indicate". |
This comment was marked as resolved.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.