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 {
134134 string getNotOkText ( ) { result = "calls with missing call target" }
135135}
136136
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+
137145module ExprTypeStats implements StatsSig {
138- int getNumberOfOk ( ) { result = count ( Expr e | not e . getType ( ) instanceof UnknownType ) }
146+ int getNumberOfOk ( ) { result = count ( SourceExpr e | hasGoodType ( e ) ) }
139147
140- int getNumberOfNotOk ( ) { result = count ( Expr e | e . getType ( ) instanceof UnknownType ) }
148+ int getNumberOfNotOk ( ) { result = count ( SourceExpr e | not hasGoodType ( e ) ) }
141149
142150 string getOkText ( ) { result = "expressions with known type" }
143151
You can’t perform that action at this time.
0 commit comments