@@ -42,22 +42,12 @@ class ExternalApi extends DotNet::Callable {
4242 /**
4343 * Gets the namespace of this API.
4444 */
45- private string getNamespace ( ) { this .getDeclaringType ( ) .hasQualifiedName ( result , _) }
45+ string getNamespace ( ) { this .getDeclaringType ( ) .hasQualifiedName ( result , _) }
4646
4747 /**
48- * Gets the assembly file name containing this API.
48+ * Gets the namespace and signature of this API.
4949 */
50- private string getAssembly ( ) { result = this .getFile ( ) .getBaseName ( ) }
51-
52- /**
53- * Gets the assembly file name and namespace of this API.
54- */
55- string getInfoPrefix ( ) { result = this .getAssembly ( ) + "#" + this .getNamespace ( ) }
56-
57- /**
58- * Gets the assembly file name, namespace and signature of this API.
59- */
60- string getInfo ( ) { result = this .getInfoPrefix ( ) + "#" + this .getSignature ( ) }
50+ string getApiName ( ) { result = this .getNamespace ( ) + "#" + this .getSignature ( ) }
6151
6252 /** Gets a call to this API callable. */
6353 DispatchCall getACall ( ) {
@@ -125,30 +115,30 @@ signature predicate relevantApi(ExternalApi api);
125115 * for restricting the number or returned results based on a certain limit.
126116 */
127117module Results< relevantApi / 1 getRelevantUsages> {
128- private int getUsages ( string apiInfo ) {
118+ private int getUsages ( string apiName ) {
129119 result =
130120 strictcount ( DispatchCall c , ExternalApi api |
131121 c = api .getACall ( ) and
132- apiInfo = api .getInfo ( ) and
122+ apiName = api .getApiName ( ) and
133123 getRelevantUsages ( api )
134124 )
135125 }
136126
137- private int getOrder ( string apiInfo ) {
138- apiInfo =
139- rank [ result ] ( string info , int usages |
140- usages = getUsages ( info )
127+ private int getOrder ( string apiName ) {
128+ apiName =
129+ rank [ result ] ( string name , int usages |
130+ usages = getUsages ( name )
141131 |
142- info order by usages desc , info
132+ name order by usages desc , name
143133 )
144134 }
145135
146136 /**
147- * Holds if there exists an API with `apiInfo ` that is being used `usages` times
137+ * Holds if there exists an API with `apiName ` that is being used `usages` times
148138 * and if it is in the top results (guarded by resultLimit).
149139 */
150- predicate restrict ( string apiInfo , int usages ) {
151- usages = getUsages ( apiInfo ) and
152- getOrder ( apiInfo ) <= resultLimit ( )
140+ predicate restrict ( string apiName , int usages ) {
141+ usages = getUsages ( apiName ) and
142+ getOrder ( apiName ) <= resultLimit ( )
153143 }
154144}
0 commit comments