Add cs/string-concatenation-in-loop to the quality suite#19650
Add cs/string-concatenation-in-loop to the quality suite#19650tamasvajk merged 1 commit intogithub:mainfrom
cs/string-concatenation-in-loop to the quality suite#19650Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR integrates the new cs/string-concatenation-in-loop performance rule into the C# code-quality suite.
- Adds the
qualitytag to the rule’s metadata. - Includes the new query in the
csharp-code-quality.qls.expectedsuite file.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| csharp/ql/src/Performance/StringConcatenationInLoop.ql | Added quality to the @tags list in the rule header |
| csharp/ql/integration-tests/posix/query-suite/csharp-code-quality.qls.expected | Registered the new query in the expected suite output |
Comments suppressed due to low confidence (1)
csharp/ql/integration-tests/posix/query-suite/csharp-code-quality.qls.expected:14
- Integration tests now include the new query in the suite, but there are no corresponding positive and negative test fixtures (e.g., sample C# files) to verify that the rule correctly flags string-concatenation-in-loop cases and accepts compliant code. Consider adding
.qltestscenarios underintegration-teststo cover both compliant and non-compliant patterns.
ql/csharp/ql/src/Performance/StringConcatenationInLoop.ql
michaelnebel
left a comment
There was a problem hiding this comment.
Looks good!
Is there a corresponding PR in the codeql-autofix repo that adds it to the CCR suite (maybe that is not needed either?).
I didn't update that suite. Should I? |
|
@michaelnebel What do you think, do we need a change note? (I think we don't) |
We shouldn't add a change note when adding a query to the |
Not sure, whether this suite was only consumed by the suite that was used by the now disabled feature flag - I have been updating it, but maybe it is not needed. Will ask in Slack. |
This PR is adding the
cs/string-concatenation-in-loopquery to the code-quality suite. I've ran the query on MRVA and then manually checked autofix suggestions. The results and the fixes are sensible.