mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
Java: Rewrite most telemetry queries to restrict the number of produced results.
This commit is contained in:
@@ -10,8 +10,7 @@ import java
|
||||
import ExternalApi
|
||||
import semmle.code.java.GeneratedFiles
|
||||
|
||||
from ExternalApi api, int usages
|
||||
where
|
||||
private predicate getRelevantUsages(ExternalApi api, int usages) {
|
||||
not api.isUninteresting() and
|
||||
api.isSink() and
|
||||
usages =
|
||||
@@ -19,4 +18,8 @@ where
|
||||
c.getCallee().getSourceDeclaration() = api and
|
||||
not c.getFile() instanceof GeneratedFile
|
||||
)
|
||||
}
|
||||
|
||||
from ExternalApi api, int usages
|
||||
where Results<getRelevantUsages/2>::restrict(api, usages)
|
||||
select api.getApiName() as apiname, usages order by usages desc
|
||||
|
||||
@@ -10,8 +10,7 @@ import java
|
||||
import ExternalApi
|
||||
import semmle.code.java.GeneratedFiles
|
||||
|
||||
from ExternalApi api, int usages
|
||||
where
|
||||
private predicate getRelevantUsages(ExternalApi api, int usages) {
|
||||
not api.isUninteresting() and
|
||||
api.isSource() and
|
||||
usages =
|
||||
@@ -19,4 +18,8 @@ where
|
||||
c.getCallee().getSourceDeclaration() = api and
|
||||
not c.getFile() instanceof GeneratedFile
|
||||
)
|
||||
}
|
||||
|
||||
from ExternalApi api, int usages
|
||||
where Results<getRelevantUsages/2>::restrict(api, usages)
|
||||
select api.getApiName() as apiname, usages order by usages desc
|
||||
|
||||
@@ -10,8 +10,7 @@ import java
|
||||
import ExternalApi
|
||||
import semmle.code.java.GeneratedFiles
|
||||
|
||||
from ExternalApi api, int usages
|
||||
where
|
||||
private predicate getRelevantUsages(ExternalApi api, int usages) {
|
||||
not api.isUninteresting() and
|
||||
api.hasSummary() and
|
||||
usages =
|
||||
@@ -19,4 +18,8 @@ where
|
||||
c.getCallee().getSourceDeclaration() = api and
|
||||
not c.getFile() instanceof GeneratedFile
|
||||
)
|
||||
}
|
||||
|
||||
from ExternalApi api, int usages
|
||||
where Results<getRelevantUsages/2>::restrict(api, usages)
|
||||
select api.getApiName() as apiname, usages order by usages desc
|
||||
|
||||
@@ -10,8 +10,7 @@ import java
|
||||
import ExternalApi
|
||||
import semmle.code.java.GeneratedFiles
|
||||
|
||||
from ExternalApi api, int usages
|
||||
where
|
||||
private predicate getRelevantUsages(ExternalApi api, int usages) {
|
||||
not api.isUninteresting() and
|
||||
not api.isSupported() and
|
||||
usages =
|
||||
@@ -19,4 +18,8 @@ where
|
||||
c.getCallee().getSourceDeclaration() = api and
|
||||
not c.getFile() instanceof GeneratedFile
|
||||
)
|
||||
}
|
||||
|
||||
from ExternalApi api, int usages
|
||||
where Results<getRelevantUsages/2>::restrict(api, usages)
|
||||
select api.getApiName() as apiname, usages order by usages desc
|
||||
|
||||
Reference in New Issue
Block a user