Repository navigation
C++: Fill gaps in query tests (part 2) - #22729
Merged
Merged
Conversation
Cover blocks with four sufficiently large nested loops and the three-loop boundary for cpp/complex-block. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Exercise alternating logical operations above and at the reporting threshold for cpp/complex-condition. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Exercise multiple forward and backward targets and a single forward target for cpp/use-of-goto. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… the tuning of the threshold.
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The fixtures do not adequately cover several query thresholds and independent predicate boundaries.
Review effort: Balanced
Findings: 3
Open (3)
What changed in this PR
Adds query tests for three existing C++ best-practice queries.
Changes:
- Adds positive and negative C++ fixtures.
- Registers inline-expectation postprocessing.
- Adds generated expected results.
| File | Description |
|---|---|
UseOfGoto/UseOfGoto.qlref |
Registers the goto query test. |
UseOfGoto/UseOfGoto.expected |
Records expected goto alert. |
UseOfGoto/UseOfGoto.cpp |
Adds goto test cases. |
ComplexCondition/ComplexCondition.qlref |
Registers the condition query test. |
ComplexCondition/ComplexCondition.expected |
Records expected complexity alert. |
ComplexCondition/ComplexCondition.cpp |
Adds condition test cases. |
BlockWithTooManyStatements/BlockWithTooManyStatements.qlref |
Registers the block query test. |
BlockWithTooManyStatements/BlockWithTooManyStatements.expected |
Records expected block alert. |
BlockWithTooManyStatements/BlockWithTooManyStatements.cpp |
Adds block-complexity test cases. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.

Fill gaps in CPP query tests, with quality queries in mind. The first three commits were generated with an AI agent (with quite a bit of context leading up to it), then I did a fourth commit adjusting and simplifying.