Skip to content

Conversation

@michaelnebel
Copy link
Contributor

@michaelnebel michaelnebel commented Aug 26, 2025

In this PR we add most medium precision queries to the codeql-quality-extended suite, with the exception of

  • cs/xmldoc/* queries as they produce an overwhelming number of results (they are also excluded for other languages).
  • cs/captured-foreach-variable as this query is related to change in semantics between C# 4 and C# 5.

DCA looks good

  • The queries don't appear to produce an overwhelming number of results.
  • The performance when adding the queries looks acceptable (adding medium precision queries adds to 30% to the analysis time compared to only running queries with precision very-high and high).

@github-actions github-actions bot added the C# label Aug 26, 2025
@michaelnebel michaelnebel force-pushed the csharp/code-quality-extended branch from 8edb66f to 7773846 Compare August 28, 2025 10:38
@michaelnebel michaelnebel force-pushed the csharp/code-quality-extended branch 2 times, most recently from 55c325d to be55348 Compare August 28, 2025 11:32
@michaelnebel michaelnebel marked this pull request as ready for review August 28, 2025 12:02
@michaelnebel michaelnebel requested a review from a team as a code owner August 28, 2025 12:02
Copilot AI review requested due to automatic review settings August 28, 2025 12:02

This comment was marked as outdated.

@michaelnebel michaelnebel marked this pull request as draft August 28, 2025 12:41
@michaelnebel michaelnebel force-pushed the csharp/code-quality-extended branch 2 times, most recently from 7773846 to 67a2966 Compare September 2, 2025 12:06
Copilot AI review requested due to automatic review settings September 4, 2025 12:35
@michaelnebel michaelnebel force-pushed the csharp/code-quality-extended branch from 67a2966 to b02107d Compare September 4, 2025 12:35
Copy link
Contributor

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 adds all medium precision quality queries to the C# code-quality-extended query suite by updating query metadata to include the "quality" tag while preserving existing tags.

  • Updates 42 C# queries by adding the "quality" tag to their metadata
  • Reorganizes existing tags to maintain proper formatting with "quality" as the primary tag
  • Updates the expected query suite output to reflect the newly included queries

Reviewed Changes

Copilot reviewed 44 out of 44 changed files in this pull request and generated no comments.

File Description
Various .ql files (42 total) Added "quality" tag while preserving existing tags like "maintainability", "reliability", etc.
not_included_in_qls.expected Removed queries that are now included in the quality suite
csharp-code-quality-extended.qls.expected Added 42 new queries to the expected output

@michaelnebel michaelnebel force-pushed the csharp/code-quality-extended branch from b02107d to 6955e24 Compare September 5, 2025 11:49
@michaelnebel michaelnebel marked this pull request as ready for review September 8, 2025 07:34
@michaelnebel michaelnebel changed the title C#: Add all medium precision quality queries to code-quality-extended. C#: Add most medium precision quality queries to code-quality-extended. Sep 8, 2025
@michaelnebel michaelnebel added the no-change-note-required This PR does not need a change note label Sep 8, 2025
@michaelnebel michaelnebel requested a review from hvitved September 9, 2025 06:56
@michaelnebel michaelnebel changed the title C#: Add most medium precision quality queries to code-quality-extended. C#: Add most medium precision queries to the code-quality-extended suite. Sep 9, 2025
* language-features
* @tags quality
* reliability
* correctness
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not convinced we should add this query; the semantics of capturing a foreach variable has been stable since C# 5, which was released in 2012.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! I was also considering it, since C# 5 is very old and it probably has limited value. Thank you for pointing it out!
Will open another PR for deprecating the query instead.

@michaelnebel michaelnebel force-pushed the csharp/code-quality-extended branch from 951be15 to 4420d09 Compare September 10, 2025 11:45
@michaelnebel
Copy link
Contributor Author

@hvitved: Since your last review, the query cs/captured-foreach-variable and cs/xmldoc/* queries have been removed from the code-quality-extended suite. The latter was removed in its entirety to align with other languages.

hvitved
hvitved previously approved these changes Sep 11, 2025
@michaelnebel michaelnebel force-pushed the csharp/code-quality-extended branch from 289884d to d903448 Compare September 16, 2025 11:58
@michaelnebel michaelnebel removed the no-change-note-required This PR does not need a change note label Sep 17, 2025
@michaelnebel
Copy link
Contributor Author

@hvitved: Added a change note since your last review.

@michaelnebel michaelnebel merged commit 398f29a into github:main Sep 17, 2025
26 checks passed
@michaelnebel michaelnebel deleted the csharp/code-quality-extended branch September 17, 2025 12:34
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.

2 participants