Skip to content

Commit d374b06

Browse files
jketemaCopilot
andcommitted
C#: Remove outdated deprecated library APIs
Remove obsolete AST, control-flow, data-flow, serialization, and security aliases, along with deprecated telemetry helpers and the old ParallelSink re-export. Keep all experimental queries and their supporting libraries. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7be1d7da-9061-47a8-bf98-b3169476add9
1 parent 799cc81 commit d374b06

31 files changed

Lines changed: 9 additions & 336 deletions
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: breaking
3+
---
4+
* Removed obsolete deprecated aliases and predicates from the AST, control-flow, data-flow, serialization, and security libraries.

‎csharp/ql/lib/semmle/code/csharp/Element.qll‎

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -95,29 +95,6 @@ class NamedElement extends Element, @named_element {
9595
/** Holds if this element has name 'name'. */
9696
final predicate hasName(string name) { name = this.getName() }
9797

98-
/**
99-
* DEPRECATED: Use `hasFullyQualifiedName` instead.
100-
*
101-
* Gets the fully qualified name of this element, for example the
102-
* fully qualified name of `M` on line 3 is `N.C.M` in
103-
*
104-
* ```csharp
105-
* namespace N {
106-
* class C {
107-
* void M(int i, string s) { }
108-
* }
109-
* }
110-
* ```
111-
*
112-
* Unbound generic types, such as `IList<T>`, are represented as
113-
* ``System.Collections.Generic.IList`1``.
114-
*/
115-
deprecated final string getFullyQualifiedName() {
116-
exists(string qualifier, string name | this.hasFullyQualifiedName(qualifier, name) |
117-
if qualifier = "" then result = name else result = qualifier + "." + name
118-
)
119-
}
120-
12198
/**
12299
* INTERNAL: Do not use.
123100
*

‎csharp/ql/lib/semmle/code/csharp/Member.qll‎

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -75,28 +75,6 @@ class Declaration extends NamedElement, @declaration {
7575
QualifiedName<FullyQualifiedNameInput>::hasQualifiedName(this, qualifier, name)
7676
}
7777

78-
/**
79-
* Gets the fully qualified name of this declaration, including types, for example
80-
* the fully qualified name with types of `M` on line 3 is `N.C.M(int, string)` in
81-
*
82-
* ```csharp
83-
* namespace N {
84-
* class C {
85-
* void M(int i, string s) { }
86-
* }
87-
* }
88-
* ```
89-
*/
90-
deprecated string getFullyQualifiedNameWithTypes() {
91-
exists(string fullqual, string qual, string name |
92-
this.getDeclaringType().hasFullyQualifiedName(qual, name) and
93-
fullqual = getQualifiedName(qual, name) and
94-
if this instanceof NestedType
95-
then result = fullqual + "+" + this.toStringWithTypes()
96-
else result = fullqual + "." + this.toStringWithTypes()
97-
)
98-
}
99-
10078
/**
10179
* Holds if this declaration has been generated by the compiler, for example
10280
* implicit constructors or accessors.

‎csharp/ql/lib/semmle/code/csharp/Type.qll‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -717,13 +717,6 @@ class Enum extends ValueType, @enum_type {
717717
* ```
718718
*/
719719
class Struct extends ValueType, @struct_type {
720-
/**
721-
* DEPRECATED: Use `instanceof RefStruct` instead.
722-
*
723-
* Holds if this `struct` has a `ref` modifier.
724-
*/
725-
deprecated predicate isRef() { this.hasModifier("ref") }
726-
727720
/** Holds if this `struct` has a `readonly` modifier. */
728721
predicate isReadonly() { this.hasModifier("readonly") }
729722

‎csharp/ql/lib/semmle/code/csharp/controlflow/Guards.qll‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -426,11 +426,6 @@ class DereferenceableExpr extends Expr {
426426
}
427427
}
428428

429-
/**
430-
* DEPRECATED: Use `EnumerableCollectionExpr` instead.
431-
*/
432-
deprecated class CollectionExpr = EnumerableCollectionExpr;
433-
434429
/**
435430
* An expression that evaluates to a collection. That is, an expression whose
436431
* (transitive, reflexive) base type is `IEnumerable`.

‎csharp/ql/lib/semmle/code/csharp/dataflow/FlowSummary.qll‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,6 @@ import csharp
44
private import internal.FlowSummaryImpl as Impl
55
private import internal.DataFlowDispatch as DataFlowDispatch
66

7-
deprecated class ParameterPosition = DataFlowDispatch::ParameterPosition;
8-
9-
deprecated class ArgumentPosition = DataFlowDispatch::ArgumentPosition;
10-
11-
deprecated class SummaryComponent = Impl::Private::SummaryComponent;
12-
13-
deprecated module SummaryComponent = Impl::Private::SummaryComponent;
14-
15-
deprecated class SummaryComponentStack = Impl::Private::SummaryComponentStack;
16-
17-
deprecated module SummaryComponentStack = Impl::Private::SummaryComponentStack;
18-
19-
deprecated class RequiredSummaryComponentStack = Impl::Private::RequiredSummaryComponentStack;
20-
217
/** Provides the `Range` class used to define the extent of `SummarizedCallable`. */
228
module SummarizedCallable {
239
class Range = Impl::Public::SummarizedCallable;

‎csharp/ql/lib/semmle/code/csharp/dataflow/SSA.qll‎

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -440,64 +440,6 @@ module Ssa {
440440
result = SsaImpl::getADefinition(this)
441441
}
442442

443-
/**
444-
* DEPRECATED.
445-
*
446-
* Holds if this definition updates a captured local scope variable, and the updated
447-
* value may be read from the implicit entry definition `def` using one or more calls
448-
* (as indicated by `additionalCalls`), starting from call `c`.
449-
*
450-
* Example:
451-
*
452-
* ```csharp
453-
* class C {
454-
* void M1() {
455-
* int i = 0;
456-
* void M2() => System.Console.WriteLine(i);
457-
* i = 1;
458-
* M2();
459-
* }
460-
* }
461-
* ```
462-
*
463-
* If this definition is the update of `i` on line 5, then the value may be read inside
464-
* `M2` via the call on line 6.
465-
*/
466-
deprecated final predicate isCapturedVariableDefinitionFlowIn(
467-
ImplicitEntryDefinition def, ControlFlowNodes::ElementNode c, boolean additionalCalls
468-
) {
469-
none()
470-
}
471-
472-
/**
473-
* DEPRECATED.
474-
*
475-
* Holds if this definition updates a captured local scope variable, and the updated
476-
* value may be read from the implicit call definition `cdef` using one or more calls
477-
* (as indicated by `additionalCalls`).
478-
*
479-
* Example:
480-
*
481-
* ```csharp
482-
* class C {
483-
* void M1() {
484-
* int i = 0;
485-
* void M2() { i = 2; };
486-
* M2();
487-
* System.Console.WriteLine(i);
488-
* }
489-
* }
490-
* ```
491-
*
492-
* If this definition is the update of `i` on line 4, then the value may be read outside
493-
* of `M2` via the call on line 5.
494-
*/
495-
deprecated final predicate isCapturedVariableDefinitionFlowOut(
496-
ImplicitCallDefinition cdef, boolean additionalCalls
497-
) {
498-
none()
499-
}
500-
501443
override Element getElement() { result = ad.getElement() }
502444
}
503445

‎csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPublic.qll‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,6 @@ class Node extends TNode {
5151

5252
/** Gets the location of this node. */
5353
final Location getLocation() { result = this.(NodeImpl).getLocationImpl() }
54-
55-
/**
56-
* Holds if this element is at the specified location.
57-
* The location spans column `startcolumn` of line `startline` to
58-
* column `endcolumn` of line `endline` in file `filepath`.
59-
* For more information, see
60-
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
61-
*/
62-
deprecated predicate hasLocationInfo(
63-
string filepath, int startline, int startcolumn, int endline, int endcolumn
64-
) {
65-
this.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
66-
}
6754
}
6855

6956
/**

‎csharp/ql/lib/semmle/code/csharp/exprs/Expr.qll‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,6 @@ class Expr extends ControlFlowElement, @expr {
8686
*/
8787
Expr stripCasts() { result = this }
8888

89-
/**
90-
* DEPRECATED: Use `stripImplicit` instead.
91-
*
92-
* Gets an expression that is the result of stripping (recursively) all
93-
* implicit casts from this expression, if any.
94-
*/
95-
deprecated Expr stripImplicitCasts() { result = this.stripImplicit() }
96-
9789
/**
9890
* Gets an expression that is the result of stripping (recursively) all
9991
* implicit casts and implicit ToString calls from this expression, if any.

‎csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -265,16 +265,6 @@ class FormatCall extends FormatStringParseCallImpl {
265265
/** Holds if this call has one or more insertions. */
266266
predicate hasInsertions() { exists(this.getArgument(this.getFirstArgument())) }
267267

268-
/**
269-
* DEPRECATED: use `hasCollectionExpr` instead.
270-
*
271-
* Holds if the arguments are supplied in an array, not individually.
272-
*/
273-
deprecated predicate hasArrayExpr() {
274-
this.getNumberOfArguments() = this.getFirstArgument() + 1 and
275-
this.getArgument(this.getFirstArgument()).getType() instanceof ArrayType
276-
}
277-
278268
/**
279269
* Holds if the arguments are supplied in a collection, not individually.
280270
*/

0 commit comments

Comments
 (0)