Repository navigation
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The refactors preserve output formatting, with only optional cleanup remaining.
1 open finding
What changed in this PR
Simplifies C++ test-output and IR-printing helpers by replacing recursive string construction with concat.
Changes:
- Use ordered concatenation for parameters, template arguments, and macro reasons.
- Replace recursive star and padding builders with repetition aggregates.
| File | Description |
|---|---|
cpp/ql/test/library-tests/sideEffects/functions/sideEffects.ql |
Concatenate function parameter types. |
cpp/ql/test/library-tests/preprocessor/macroinvocations/getanaffectedelement.ql |
Concatenate sorted macro reasons. |
cpp/ql/test/library-tests/dataflow/dataflow-tests/has-parameter-flow-out.ql |
Simplify indirection-star generation. |
cpp/ql/test/library-tests/cpp11_g/cfg.ql |
Concatenate template arguments. |
cpp/ql/test/library-tests/blocks/cpp/code_blocks.ql |
Concatenate C++ block parameters. |
cpp/ql/test/library-tests/blocks/c/code_blocks.ql |
Concatenate C block parameters. |
cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/PrintIR.qll |
Simplify unaliased SSA padding. |
cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/PrintIR.qll |
Simplify raw IR padding. |
cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/PrintIR.qll |
Simplify aliased SSA padding. |
🧠 Review effort: Max
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| private string stars(int k) { | ||
| k = [0 .. max(DataFlow::Node n, int i | n.isFinalValueOfParameter(_, i) | i)] and | ||
| (if k = 0 then result = "" else result = "*" + stars(k - 1)) | ||
| result = concat(int i | i in [1 .. k] | "*") |
This branch has not been deployed
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.

This is all test code, so no need to run DCA.