Skip to content

Commit 3f843d8

Browse files
committed
Add telemetry query for known/unknown expression kinds
1 parent e62d542 commit 3f843d8

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

csharp/ql/src/Telemetry/ExtractorInformation.ql

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,16 @@ module AccessTargetStats implements StatsSig {
145145
string getNotOkText() { result = "access with missing target" }
146146
}
147147

148+
module ExprStats implements StatsSig {
149+
int getNumberOfOk() { result = count(Expr e | not e instanceof @unknown_expr) }
150+
151+
int getNumberOfNotOk() { result = count(Expr e | e instanceof @unknown_expr) }
152+
153+
string getOkText() { result = "expressions with known kind" }
154+
155+
string getNotOkText() { result = "expressions with unknown kind" }
156+
}
157+
148158
module CallTargetStatsReport = ReportStats<CallTargetStats>;
149159

150160
module ExprTypeStatsReport = ReportStats<ExprTypeStats>;
@@ -153,6 +163,8 @@ module TypeMentionTypeStatsReport = ReportStats<TypeMentionTypeStats>;
153163

154164
module AccessTargetStatsReport = ReportStats<AccessTargetStats>;
155165

166+
module ExprStatsReport = ReportStats<ExprStats>;
167+
156168
from string key, float value
157169
where
158170
fileCount(key, value) or
@@ -176,5 +188,8 @@ where
176188
TypeMentionTypeStatsReport::percentageOfOk(key, value) or
177189
AccessTargetStatsReport::numberOfOk(key, value) or
178190
AccessTargetStatsReport::numberOfNotOk(key, value) or
179-
AccessTargetStatsReport::percentageOfOk(key, value)
191+
AccessTargetStatsReport::percentageOfOk(key, value) or
192+
ExprStatsReport::numberOfOk(key, value) or
193+
ExprStatsReport::numberOfNotOk(key, value) or
194+
ExprStatsReport::percentageOfOk(key, value)
180195
select key, value

0 commit comments

Comments
 (0)