mirror of
https://github.com/github/codeql.git
synced 2026-04-21 15:05:56 +02:00
C#: Adjust known type telemetry query
This commit is contained in:
@@ -134,10 +134,18 @@ module CallTargetStats implements StatsSig {
|
||||
string getNotOkText() { result = "calls with missing call target" }
|
||||
}
|
||||
|
||||
module ExprTypeStats implements StatsSig {
|
||||
int getNumberOfOk() { result = count(Expr e | not e.getType() instanceof UnknownType) }
|
||||
private class SourceExpr extends Expr {
|
||||
SourceExpr() { this.getFile().fromSource() }
|
||||
}
|
||||
|
||||
int getNumberOfNotOk() { result = count(Expr e | e.getType() instanceof UnknownType) }
|
||||
private predicate hasGoodType(Expr e) {
|
||||
exists(e.getType()) and not e.getType() instanceof UnknownType
|
||||
}
|
||||
|
||||
module ExprTypeStats implements StatsSig {
|
||||
int getNumberOfOk() { result = count(SourceExpr e | hasGoodType(e)) }
|
||||
|
||||
int getNumberOfNotOk() { result = count(SourceExpr e | not hasGoodType(e)) }
|
||||
|
||||
string getOkText() { result = "expressions with known type" }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user