-
Notifications
You must be signed in to change notification settings - Fork 0
C#: Rename ForeachStmt to ForEachStmt. #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: qa/agent-github-codeql/pr-12-22492/base
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -305,7 +305,7 @@ class DefaultCase extends CaseStmt, LabeledStmt { | |
| * | ||
| * Either a `while` statement (`WhileStmt`), a `do`-`while` statement | ||
| * (`DoStmt`), a `for` statement (`ForStmt`), or a `foreach` statement | ||
| * (`ForeachStmt`). | ||
| * (`ForEachStmt`). | ||
| */ | ||
| class LoopStmt extends Stmt, @loop_stmt { | ||
| /** Gets the body of this loop statement. */ | ||
|
|
@@ -422,6 +422,9 @@ class ForStmt extends LoopStmt, @for_stmt { | |
| override string getAPrimaryQlClass() { result = "ForStmt" } | ||
| } | ||
|
|
||
| /** DEPRECATED: Use `ForEachStmt` instead. */ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shipwright · CRITICAL The deprecated alias 'ForeachStmt' is defined as 'deprecated class ForeachStmt = ForEachStmt;' in Stmt.qll, but the new class 'ForEachStmt' overrides 'getAPrimaryQlClass()' to retu Impact: The deprecated alias 'ForeachStmt' is defined as 'deprecated class ForeachStmt = ForEachStmt;' in Stmt.qll, but the new class 'ForEachStmt' overrides 'getAPrimaryQlClass()' to return "ForEachStmt". Any existing query or library that still references the deprecated 'ForeachStmt' name and relies on the primary QL class string "ForeachStmt" (e.g., for AST printing, dbscheme mapping, or query result classification) will… Suggested fix: Review the cited evidence, fix the risk if confirmed, and rerun Shipwright. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shipwright · HIGH The deprecated alias 'ForeachStmt' is declared in 'Stmt.qll' but the new class 'ForEachStmt' is defined in the same file with the same '@foreach_stmt' database type. Impact: The deprecated alias 'ForeachStmt' is declared in 'Stmt.qll' but the new class 'ForEachStmt' is defined in the same file with the same '@foreach_stmt' database type. The alias does not include any deprecation message or migration guidance, and the comment '/** DEPRECATED: Use ForEachStmt instead. */' is the only documentation. A new hire or downstream maintainer encountering the alias will not know whether the alias… Suggested fix: Review the cited evidence, fix the risk if confirmed, and rerun Shipwright. |
||
| deprecated class ForeachStmt = ForEachStmt; | ||
|
|
||
| /** | ||
| * A `foreach` loop, for example | ||
| * | ||
|
|
@@ -431,7 +434,7 @@ class ForStmt extends LoopStmt, @for_stmt { | |
| * } | ||
| * ``` | ||
| */ | ||
| class ForeachStmt extends LoopStmt, @foreach_stmt { | ||
| class ForEachStmt extends LoopStmt, @foreach_stmt { | ||
| /** | ||
| * Gets the local variable of this `foreach` loop, if any. | ||
| * | ||
|
|
@@ -564,7 +567,7 @@ class ForeachStmt extends LoopStmt, @foreach_stmt { | |
|
|
||
| override string toString() { result = "foreach (... ... in ...) ..." } | ||
|
|
||
| override string getAPrimaryQlClass() { result = "ForeachStmt" } | ||
| override string getAPrimaryQlClass() { result = "ForEachStmt" } | ||
| } | ||
|
|
||
| /** | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| import csharp | ||
|
|
||
| from ForeachStmt stmt, int i | ||
| from ForEachStmt stmt, int i | ||
| select stmt, i, stmt.getVariableDeclExpr(i), stmt.getVariable(i), stmt.getIterableExpr(), | ||
| stmt.getBody() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shipwright · CRITICAL
The deprecated aliases in Linq/Helpers.qll are declared as 'deprecated class ForeachStmtGenericEnumerable = ForEachStmtGenericEnumerable;' and 'deprecated class ForeachStmtEnumerab
Impact: The deprecated aliases in Linq/Helpers.qll are declared as 'deprecated class ForeachStmtGenericEnumerable = ForEachStmtGenericEnumerable;' and 'deprecated class ForeachStmtEnumerable = ForEachStmtEnumerable;'. These aliases reference the new class names, but the new classes themselves are defined immediately after the aliases. In QL, a class alias to a class that is not yet declared at that point may cause a compila…
Suggested fix: Review the cited evidence, fix the risk if confirmed, and rerun Shipwright.