C#: Exclude delegate and dynamic calls from extractor telemetry

This commit is contained in:
Tom Hvitved
2024-04-16 12:53:39 +02:00
parent f57e0cb71e
commit 6bf05eb29a

View File

@@ -120,7 +120,14 @@ module ReportStats<StatsSig Stats> {
module CallTargetStats implements StatsSig {
int getNumberOfOk() { result = count(Call c | exists(c.getTarget())) }
int getNumberOfNotOk() { result = count(Call c | not exists(c.getTarget())) }
int getNumberOfNotOk() {
result =
count(Call c |
not exists(c.getTarget()) and
not c instanceof DelegateCall and
not c instanceof DynamicExpr
)
}
string getOkText() { result = "calls with call target" }