Skip to content

Commit 4be15af

Browse files
committed
C#: Add missing QlDoc for various predicates
1 parent ce68e45 commit 4be15af

File tree

6 files changed

+15
-0
lines changed

6 files changed

+15
-0
lines changed

csharp/ql/src/semmle/code/cil/Access.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class ReadRefAccess extends ReadAccess, ReadRef { }
3131

3232
/** An instruction that writes a variable. */
3333
class WriteAccess extends VariableAccess, @cil_write_access {
34+
/** Gets the `Expr` whose value is used in this variable write. */
3435
Expr getExpr() { none() }
3536
}
3637

csharp/ql/src/semmle/code/csharp/Callable.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,9 @@ class Operator extends Callable, Member, Attributable, @operator {
437437

438438
override string getName() { operators(this, _, result, _, _, _) }
439439

440+
/**
441+
* Gets the metadata name of the operator, such as `op_implicit` or `op_RightShift`.
442+
*/
440443
string getFunctionName() { none() }
441444

442445
override ValueOrRefType getDeclaringType() { operators(this, _, _, result, _, _) }

csharp/ql/src/semmle/code/csharp/Conversion.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,11 @@ predicate convNullableType(ValueOrRefType fromType, NullableType toType) {
514514
)
515515
}
516516

517+
/**
518+
* Holds if `fromType` is `NullType`, and `toType` is a type that can represent
519+
* the `null` value, such as a reference type, `Nullable<T>` or a type parameter
520+
* with contraints that restrict it to a reference type.
521+
*/
517522
// This is a deliberate, small Cartesian product, so we have manually lifted it to force the
518523
// evaluator to evaluate it in its entirety, rather than trying to optimize it in context.
519524
pragma[noinline]

csharp/ql/src/semmle/code/csharp/dispatch/RuntimeCallable.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class RuntimeMethod extends RuntimeCallable {
2626
this instanceof CIL::Method
2727
}
2828

29+
/** Holds if the method is `static`. */
2930
predicate isStatic() { this.(Method).isStatic() or this.(CIL::Method).isStatic() }
3031
}
3132

csharp/ql/src/semmle/code/csharp/exprs/Expr.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,7 @@ class RangeExpr extends Expr, @range_expr {
10111011

10121012
/** An index expression, for example `^1` meaning "1 from the end". */
10131013
class IndexExpr extends Expr, @index_expr {
1014+
/** Gets the sub expression of this `IndexExpr`. */
10141015
Expr getExpr() { result.getParent() = this }
10151016

10161017
override string toString() { result = "^..." }

csharp/ql/src/semmle/code/csharp/metrics/Coupling.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@ predicate shareFieldOrProperty(ValueOrRefType t, Method m1, Method m2) {
222222
)
223223
}
224224

225+
/**
226+
* Holds if `Method` `m` is declared in `ValueOrRefType` `t`, and if there's a
227+
* `FieldAccess` or `PropertyAccess` in `m` that accesses `Declaration` `d`.
228+
*/
225229
predicate methodUsesFieldOrProperty(ValueOrRefType t, Method m, Declaration d) {
226230
m.getDeclaringType() = t and
227231
(

0 commit comments

Comments
 (0)