Skip to content

Conversation

michaelnebel
Copy link
Contributor

@michaelnebel michaelnebel commented Sep 1, 2025

Fix some Ql4Ql violations based on the following checks

  • ql/field-only-used-in-charpred
  • ql/could-be-cast
  • ql/counting-to-zero
  • ql/dataflow-module-naming-convention
  • ql/if-with-none
  • ql/missing-parameter-qldoc
  • ql/misspelling

DCA looks good.

@github-actions github-actions bot added the C# label Sep 1, 2025
@michaelnebel michaelnebel added the no-change-note-required This PR does not need a change note label Sep 2, 2025
@michaelnebel michaelnebel marked this pull request as ready for review September 2, 2025 07:28
@michaelnebel michaelnebel requested a review from a team as a code owner September 2, 2025 07:28
@Copilot Copilot AI review requested due to automatic review settings September 2, 2025 07:28
Copy link
Contributor

@Copilot 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 fixes various Ql4Ql violations identified by automated checks, focusing on code quality improvements in the C# CodeQL library. The changes include refactoring to use more idiomatic CodeQL patterns, fixing spelling errors, and improving code documentation.

Key changes:

  • Replace exists patterns with more concise instanceof checks
  • Fix spelling errors in class names and predicates
  • Move field declarations inside exists clauses to improve scoping
  • Add missing parameter documentation

Reviewed Changes

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

Show a summary per file
File Description
DatabaseQuality.qll Replace exists with instanceof for cleaner type checking
UselessUpcast.ql Move field declaration inside exists clause for better scoping
MagicConstants.qll Fix spelling error from "occurence" to "occurrence"
Deserializers.qll Fix spelling error in class name and add deprecated alias
UnsafeDeserializationQuery.qll Update reference to corrected class name
SsaImpl.qll Add missing parameter documentation
SSA.qll Remove unused field by using wildcard in exists clause
Completion.qll Replace field with inline any() expression
PrintAst.qll Refactor to use any() pattern instead of field
Member.qll Add missing parameter documentation
Callable.qll Fix spelling error "substraction" to "subtraction"
Assignable.qll Add missing parameter documentation
printAst.ql Fix documentation grammar
Comments suppressed due to low confidence (1)

csharp/ql/lib/printAst.ql:22

  • Grammar error: 'the element is e is fromSource' should be 'the element e is fromSource' (remove duplicate 'is').
   * Holds if the location `l` matches the selected file in the VS Code extension and
   * the element is `e` is `fromSource`.

@michaelnebel michaelnebel merged commit 39d3741 into github:main Sep 2, 2025
26 checks passed
@michaelnebel michaelnebel deleted the csharp/ql4ql branch September 2, 2025 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C# no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants