mirror of
https://github.com/github/codeql.git
synced 2026-04-27 01:35:13 +02:00
Exclude type parameter instantiations from DB quality query
This commit is contained in:
@@ -83,6 +83,10 @@ module CallTargetStats implements StatsSig {
|
||||
)
|
||||
}
|
||||
|
||||
private predicate isTypeParameterInstantiation(ObjectCreation e) {
|
||||
e.getType() instanceof TypeParameter
|
||||
}
|
||||
|
||||
additional predicate isNotOkCall(Call c) {
|
||||
not exists(c.getTarget()) and
|
||||
not c instanceof DelegateCall and
|
||||
@@ -92,7 +96,8 @@ module CallTargetStats implements StatsSig {
|
||||
not isAnonymousObjectMemberDeclaration(c) and
|
||||
not isInitializedWithCollectionInitializer(c) and
|
||||
not c.getParent+() instanceof NameOfExpr and
|
||||
not isEventFieldAccess(c)
|
||||
not isEventFieldAccess(c) and
|
||||
not isTypeParameterInstantiation(c)
|
||||
}
|
||||
|
||||
int getNumberOfNotOk() { result = count(Call c | isNotOkCall(c)) }
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
| Quality.cs:25:19:25:26 | access to indexer | Call without target $@. | Quality.cs:25:19:25:26 | access to indexer | access to indexer |
|
||||
| Quality.cs:28:21:28:27 | access to indexer | Call without target $@. | Quality.cs:28:21:28:27 | access to indexer | access to indexer |
|
||||
| Quality.cs:31:9:31:21 | access to indexer | Call without target $@. | Quality.cs:31:9:31:21 | access to indexer | access to indexer |
|
||||
| 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 |
|
||||
|
||||
Reference in New Issue
Block a user