@@ -53,24 +53,24 @@ class ExternalApi extends DotNet::Callable {
5353 */
5454 string getApiName ( ) { result = this .getNamespace ( ) + "#" + this .getSignature ( ) }
5555
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-
6356 /** Gets a node that is an input to a call to this API. */
6457 private ArgumentNode getAnInput ( ) {
65- result .getCall ( ) .( DataFlowDispatch:: NonDelegateDataFlowCall ) .getDispatchCall ( ) = this .getACall ( )
58+ result
59+ .getCall ( )
60+ .( DataFlowDispatch:: NonDelegateDataFlowCall )
61+ .getATarget ( _)
62+ .getUnboundDeclaration ( ) = this
6663 }
6764
6865 /** Gets a node that is an output from a call to this API. */
6966 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
7272 |
73- this . getACall ( ) = call . getDispatchCall ( )
73+ result = ret . getAnOutNode ( dc )
7474 )
7575 }
7676
@@ -121,8 +121,8 @@ signature predicate relevantApi(ExternalApi api);
121121module Results< relevantApi / 1 getRelevantUsages> {
122122 private int getUsages ( string apiName ) {
123123 result =
124- strictcount ( DispatchCall c , ExternalApi api |
125- c = api . getACall ( ) and
124+ strictcount ( Call c , ExternalApi api |
125+ c . getTarget ( ) . getUnboundDeclaration ( ) = api and
126126 apiName = api .getApiName ( ) and
127127 getRelevantUsages ( api )
128128 )
0 commit comments