Skip to content

Commit b3896df

Browse files
committed
Exclude type parameter instantiations from DB quality query
1 parent 5d79ed6 commit b3896df

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

csharp/ql/src/Telemetry/DatabaseQuality.qll

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ module CallTargetStats implements StatsSig {
8383
)
8484
}
8585

86+
private predicate isTypeParameterInstantiation(ObjectCreation e) {
87+
e.getType() instanceof TypeParameter
88+
}
89+
8690
additional predicate isNotOkCall(Call c) {
8791
not exists(c.getTarget()) and
8892
not c instanceof DelegateCall and
@@ -92,7 +96,8 @@ module CallTargetStats implements StatsSig {
9296
not isAnonymousObjectMemberDeclaration(c) and
9397
not isInitializedWithCollectionInitializer(c) and
9498
not c.getParent+() instanceof NameOfExpr and
95-
not isEventFieldAccess(c)
99+
not isEventFieldAccess(c) and
100+
not isTypeParameterInstantiation(c)
96101
}
97102

98103
int getNumberOfNotOk() { result = count(Call c | isNotOkCall(c)) }
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
| Quality.cs:25:19:25:26 | access to indexer | Call without target $@. | Quality.cs:25:19:25:26 | access to indexer | access to indexer |
22
| Quality.cs:28:21:28:27 | access to indexer | Call without target $@. | Quality.cs:28:21:28:27 | access to indexer | access to indexer |
33
| Quality.cs:31:9:31:21 | access to indexer | Call without target $@. | Quality.cs:31:9:31:21 | access to indexer | access to indexer |
4-
| Quality.cs:46:20:46:26 | object creation of type T | Call without target $@. | Quality.cs:46:20:46:26 | object creation of type T | object creation of type T |

0 commit comments

Comments
 (0)