Java: Refactor most of the logic out of the model editor query files

This commit is contained in:
Koen Vlaswinkel
2023-09-20 14:13:28 +02:00
parent 509b7fe0f8
commit 73ebd21c33
4 changed files with 19 additions and 7 deletions

View File

@@ -8,12 +8,9 @@
*/
private import java
private import ApplicationModeEndpointsQuery
private import ModelEditor
class ExternalEndpoint extends Endpoint {
ExternalEndpoint() { not this.fromSource() }
}
private Call aUsage(ExternalEndpoint endpoint) {
result.getCallee().getSourceDeclaration() = endpoint
}

View File

@@ -0,0 +1,9 @@
private import java
private import ModelEditor
/**
* A class of effectively public callables in library code.
*/
class ExternalEndpoint extends Endpoint {
ExternalEndpoint() { not this.fromSource() }
}

View File

@@ -8,11 +8,9 @@
*/
private import java
private import semmle.code.java.dataflow.internal.ModelExclusions
private import FrameworkModeEndpointsQuery
private import ModelEditor
class PublicEndpointFromSource extends Endpoint, ModelApi { }
from PublicEndpointFromSource endpoint, string apiName, boolean supported, string type
where
apiName = endpoint.getApiName() and

View File

@@ -0,0 +1,8 @@
private import java
private import semmle.code.java.dataflow.internal.ModelExclusions
private import ModelEditor
/**
* A class of effectively public callables from source code.
*/
class PublicEndpointFromSource extends Endpoint, ModelApi { }