File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -134,10 +134,18 @@ module CallTargetStats implements StatsSig {
134
134
string getNotOkText ( ) { result = "calls with missing call target" }
135
135
}
136
136
137
+ private class SourceExpr extends Expr {
138
+ SourceExpr ( ) { this .getFile ( ) .fromSource ( ) }
139
+ }
140
+
141
+ private predicate hasGoodType ( Expr e ) {
142
+ exists ( e .getType ( ) ) and not e .getType ( ) instanceof UnknownType
143
+ }
144
+
137
145
module ExprTypeStats implements StatsSig {
138
- int getNumberOfOk ( ) { result = count ( Expr e | not e . getType ( ) instanceof UnknownType ) }
146
+ int getNumberOfOk ( ) { result = count ( SourceExpr e | hasGoodType ( e ) ) }
139
147
140
- int getNumberOfNotOk ( ) { result = count ( Expr e | e . getType ( ) instanceof UnknownType ) }
148
+ int getNumberOfNotOk ( ) { result = count ( SourceExpr e | not hasGoodType ( e ) ) }
141
149
142
150
string getOkText ( ) { result = "expressions with known type" }
143
151
You can’t perform that action at this time.
0 commit comments