add all remaining explicit this

This commit is contained in:
Erik Krogh Kristensen
2021-11-26 13:50:10 +01:00
parent 00ee34c0a0
commit 6ff8d4de5c
104 changed files with 479 additions and 451 deletions

View File

@@ -16,7 +16,7 @@ class ExternalAPI extends Callable {
ExternalAPI() { not this.fromSource() }
/** Holds if this API is not worth supporting */
predicate isUninteresting() { isTestLibrary() or isParameterlessConstructor() }
predicate isUninteresting() { this.isTestLibrary() or this.isParameterlessConstructor() }
/** Holds if this API is is a constructor without parameters */
predicate isParameterlessConstructor() {
@@ -24,7 +24,7 @@ class ExternalAPI extends Callable {
}
/** Holds if this API is part of a common testing library or framework */
private predicate isTestLibrary() { getDeclaringType() instanceof TestLibrary }
private predicate isTestLibrary() { this.getDeclaringType() instanceof TestLibrary }
/**
* Gets information about the external API in the form expected by the CSV modeling framework.
@@ -38,7 +38,9 @@ class ExternalAPI extends Callable {
/**
* Gets the jar file containing this API. Normalizes the Java Runtime to "rt.jar" despite the presence of modules.
*/
string jarContainer() { result = containerAsJar(this.getCompilationUnit().getParentContainer*()) }
string jarContainer() {
result = this.containerAsJar(this.getCompilationUnit().getParentContainer*())
}
private string containerAsJar(Container container) {
if container instanceof JarFile then result = container.getBaseName() else result = "rt.jar"
@@ -75,12 +77,12 @@ class ExternalAPI extends Callable {
predicate isSink() { sinkNode(this.getAnInput(), _) }
/** Holds if this API is supported by existing CodeQL libraries, that is, it is either a recognized source or sink or has a flow summary. */
predicate isSupported() { hasSummary() or isSource() or isSink() }
predicate isSupported() { this.hasSummary() or this.isSource() or this.isSink() }
}
private class TestLibrary extends RefType {
TestLibrary() {
getPackage()
this.getPackage()
.getName()
.matches([
"org.junit%", "junit.%", "org.mockito%", "org.assertj%",