@@ -53,24 +53,24 @@ class ExternalApi extends DotNet::Callable {
53
53
*/
54
54
string getApiName ( ) { result = this .getNamespace ( ) + "#" + this .getSignature ( ) }
55
55
56
- /** Gets a call to this API callable. */
57
- DispatchCall getACall ( ) {
58
- this = result .getADynamicTarget ( ) .getUnboundDeclaration ( )
59
- or
60
- this = result .getAStaticTarget ( ) .getUnboundDeclaration ( )
61
- }
62
-
63
56
/** Gets a node that is an input to a call to this API. */
64
57
private ArgumentNode getAnInput ( ) {
65
- result .getCall ( ) .( DataFlowDispatch:: NonDelegateDataFlowCall ) .getDispatchCall ( ) = this .getACall ( )
58
+ result
59
+ .getCall ( )
60
+ .( DataFlowDispatch:: NonDelegateDataFlowCall )
61
+ .getATarget ( _)
62
+ .getUnboundDeclaration ( ) = this
66
63
}
67
64
68
65
/** Gets a node that is an output from a call to this API. */
69
66
private DataFlow:: Node getAnOutput ( ) {
70
- exists ( DataFlowDispatch:: NonDelegateDataFlowCall call , DataFlowImplCommon:: ReturnKindExt ret |
71
- result = ret .getAnOutNode ( call )
67
+ exists (
68
+ Call c , DataFlowDispatch:: NonDelegateDataFlowCall dc , DataFlowImplCommon:: ReturnKindExt ret
69
+ |
70
+ dc .getDispatchCall ( ) .getCall ( ) = c and
71
+ c .getTarget ( ) .getUnboundDeclaration ( ) = this
72
72
|
73
- this . getACall ( ) = call . getDispatchCall ( )
73
+ result = ret . getAnOutNode ( dc )
74
74
)
75
75
}
76
76
@@ -121,8 +121,8 @@ signature predicate relevantApi(ExternalApi api);
121
121
module Results< relevantApi / 1 getRelevantUsages> {
122
122
private int getUsages ( string apiName ) {
123
123
result =
124
- strictcount ( DispatchCall c , ExternalApi api |
125
- c = api . getACall ( ) and
124
+ strictcount ( Call c , ExternalApi api |
125
+ c . getTarget ( ) . getUnboundDeclaration ( ) = api and
126
126
apiName = api .getApiName ( ) and
127
127
getRelevantUsages ( api )
128
128
)
0 commit comments