@@ -42,22 +42,12 @@ class ExternalApi extends DotNet::Callable {
42
42
/**
43
43
* Gets the namespace of this API.
44
44
*/
45
- private string getNamespace ( ) { this .getDeclaringType ( ) .hasQualifiedName ( result , _) }
45
+ string getNamespace ( ) { this .getDeclaringType ( ) .hasQualifiedName ( result , _) }
46
46
47
47
/**
48
- * Gets the assembly file name containing this API.
48
+ * Gets the namespace and signature of this API.
49
49
*/
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 ( ) }
61
51
62
52
/** Gets a call to this API callable. */
63
53
DispatchCall getACall ( ) {
@@ -125,30 +115,30 @@ signature predicate relevantApi(ExternalApi api);
125
115
* for restricting the number or returned results based on a certain limit.
126
116
*/
127
117
module Results< relevantApi / 1 getRelevantUsages> {
128
- private int getUsages ( string apiInfo ) {
118
+ private int getUsages ( string apiName ) {
129
119
result =
130
120
strictcount ( DispatchCall c , ExternalApi api |
131
121
c = api .getACall ( ) and
132
- apiInfo = api .getInfo ( ) and
122
+ apiName = api .getApiName ( ) and
133
123
getRelevantUsages ( api )
134
124
)
135
125
}
136
126
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 )
141
131
|
142
- info order by usages desc , info
132
+ name order by usages desc , name
143
133
)
144
134
}
145
135
146
136
/**
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
148
138
* and if it is in the top results (guarded by resultLimit).
149
139
*/
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 ( )
153
143
}
154
144
}
0 commit comments