Skip to content

Commit ced95e0

Browse files
committed
Java: Split API name column into separate columns
1 parent f4522ed commit ced95e0

File tree

5 files changed

+47
-43
lines changed

5 files changed

+47
-43
lines changed

java/ql/src/utils/modeleditor/ApplicationModeEndpoints.ql

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ private Call aUsage(ExternalEndpoint endpoint) {
1414
result.getCallee().getSourceDeclaration() = endpoint
1515
}
1616

17-
from
18-
ExternalEndpoint endpoint, string apiName, boolean supported, Call usage, string type,
19-
string classification
17+
from ExternalEndpoint endpoint, boolean supported, Call usage, string type, string classification
2018
where
21-
apiName = endpoint.getApiName() and
2219
supported = isSupported(endpoint) and
2320
usage = aUsage(endpoint) and
2421
type = supportedType(endpoint) and
2522
classification = usageClassification(usage)
26-
select usage, apiName, supported, endpoint.jarContainer(), endpoint.jarVersion(), type,
23+
select usage, endpoint.getPackageName(), endpoint.getTypeName(), endpoint.getName(),
24+
endpoint.getParameterTypes(), supported, endpoint.jarContainer(), endpoint.jarVersion(), type,
2725
classification

java/ql/src/utils/modeleditor/FrameworkModeEndpoints.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ private import java
1010
private import FrameworkModeEndpointsQuery
1111
private import ModelEditor
1212

13-
from PublicEndpointFromSource endpoint, string apiName, boolean supported, string type
13+
from PublicEndpointFromSource endpoint, boolean supported, string type
1414
where
15-
apiName = endpoint.getApiName() and
1615
supported = isSupported(endpoint) and
1716
type = supportedType(endpoint)
18-
select endpoint, apiName, supported,
17+
select endpoint, endpoint.getPackageName(), endpoint.getTypeName(), endpoint.getName(),
18+
endpoint.getParameterTypes(), supported,
1919
endpoint.getCompilationUnit().getParentContainer().getBaseName(), type

java/ql/src/utils/modeleditor/ModelEditor.qll

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,19 @@ class Endpoint extends Callable {
2020
Endpoint() { not isUninteresting(this) }
2121

2222
/**
23-
* Gets information about the external API in the form expected by the MaD modeling framework.
23+
* Gets the package name of this endpoint.
2424
*/
25-
string getApiName() {
26-
result =
27-
this.getDeclaringType().getPackage() + "." + this.getDeclaringType().nestedName() + "#" +
28-
this.getName() + paramsString(this)
29-
}
25+
string getPackageName() { result = this.getDeclaringType().getPackage().getName() }
26+
27+
/**
28+
* Gets the type name of this endpoint.
29+
*/
30+
string getTypeName() { result = this.getDeclaringType().nestedName() }
31+
32+
/**
33+
* Gets the parameter types of this endpoint.
34+
*/
35+
string getParameterTypes() { result = paramsString(this) }
3036

3137
private string getJarName() {
3238
result = this.getCompilationUnit().getParentContainer*().(JarFile).getBaseName()
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
| com/github/codeql/test/NonPublicClass.java:5:5:5:28 | println(...) | java.io.PrintStream#println(String) | true | rt.jar | | sink | source |
2-
| com/github/codeql/test/PublicClass.java:8:5:8:27 | println(...) | java.io.PrintStream#println(String) | true | rt.jar | | sink | source |
3-
| com/github/codeql/test/PublicClass.java:12:5:12:27 | println(...) | java.io.PrintStream#println(String) | true | rt.jar | | sink | source |
4-
| com/github/codeql/test/PublicClass.java:16:5:16:45 | println(...) | java.io.PrintStream#println(Object) | true | rt.jar | | sink | source |
5-
| com/github/codeql/test/PublicClass.java:16:24:16:44 | get(...) | java.nio.file.Paths#get(String,String[]) | true | rt.jar | | sink | source |
6-
| com/github/codeql/test/PublicClass.java:16:24:16:44 | get(...) | java.nio.file.Paths#get(String,String[]) | true | rt.jar | | summary | source |
7-
| com/github/codeql/test/PublicClass.java:20:5:20:68 | println(...) | java.io.PrintStream#println(Object) | true | rt.jar | | sink | source |
8-
| com/github/codeql/test/PublicClass.java:20:24:20:47 | getDefault(...) | java.nio.file.FileSystems#getDefault() | false | rt.jar | | | source |
9-
| com/github/codeql/test/PublicClass.java:20:24:20:67 | getPath(...) | java.nio.file.FileSystem#getPath(String,String[]) | true | rt.jar | | sink | source |
10-
| com/github/codeql/test/PublicClass.java:20:24:20:67 | getPath(...) | java.nio.file.FileSystem#getPath(String,String[]) | true | rt.jar | | summary | source |
11-
| com/github/codeql/test/PublicClass.java:24:5:24:27 | println(...) | java.io.PrintStream#println(String) | true | rt.jar | | sink | source |
12-
| com/github/codeql/test/PublicGenericClass.java:7:5:7:27 | println(...) | java.io.PrintStream#println(Object) | true | rt.jar | | sink | source |
13-
| com/github/codeql/test/PublicGenericClass.java:11:5:11:27 | println(...) | java.io.PrintStream#println(Object) | true | rt.jar | | sink | source |
14-
| com/github/codeql/test/PublicGenericInterface.java:8:7:8:29 | println(...) | java.io.PrintStream#println(String) | true | rt.jar | | sink | source |
15-
| com/github/codeql/test/PublicInterface.java:7:7:7:29 | println(...) | java.io.PrintStream#println(String) | true | rt.jar | | sink | source |
1+
| com/github/codeql/test/NonPublicClass.java:5:5:5:28 | println(...) | java.io | PrintStream | println | (String) | true | rt.jar | | sink | source |
2+
| com/github/codeql/test/PublicClass.java:8:5:8:27 | println(...) | java.io | PrintStream | println | (String) | true | rt.jar | | sink | source |
3+
| com/github/codeql/test/PublicClass.java:12:5:12:27 | println(...) | java.io | PrintStream | println | (String) | true | rt.jar | | sink | source |
4+
| com/github/codeql/test/PublicClass.java:16:5:16:45 | println(...) | java.io | PrintStream | println | (Object) | true | rt.jar | | sink | source |
5+
| com/github/codeql/test/PublicClass.java:16:24:16:44 | get(...) | java.nio.file | Paths | get | (String,String[]) | true | rt.jar | | sink | source |
6+
| com/github/codeql/test/PublicClass.java:16:24:16:44 | get(...) | java.nio.file | Paths | get | (String,String[]) | true | rt.jar | | summary | source |
7+
| com/github/codeql/test/PublicClass.java:20:5:20:68 | println(...) | java.io | PrintStream | println | (Object) | true | rt.jar | | sink | source |
8+
| com/github/codeql/test/PublicClass.java:20:24:20:47 | getDefault(...) | java.nio.file | FileSystems | getDefault | () | false | rt.jar | | | source |
9+
| com/github/codeql/test/PublicClass.java:20:24:20:67 | getPath(...) | java.nio.file | FileSystem | getPath | (String,String[]) | true | rt.jar | | sink | source |
10+
| com/github/codeql/test/PublicClass.java:20:24:20:67 | getPath(...) | java.nio.file | FileSystem | getPath | (String,String[]) | true | rt.jar | | summary | source |
11+
| com/github/codeql/test/PublicClass.java:24:5:24:27 | println(...) | java.io | PrintStream | println | (String) | true | rt.jar | | sink | source |
12+
| com/github/codeql/test/PublicGenericClass.java:7:5:7:27 | println(...) | java.io | PrintStream | println | (Object) | true | rt.jar | | sink | source |
13+
| com/github/codeql/test/PublicGenericClass.java:11:5:11:27 | println(...) | java.io | PrintStream | println | (Object) | true | rt.jar | | sink | source |
14+
| com/github/codeql/test/PublicGenericInterface.java:8:7:8:29 | println(...) | java.io | PrintStream | println | (String) | true | rt.jar | | sink | source |
15+
| com/github/codeql/test/PublicInterface.java:7:7:7:29 | println(...) | java.io | PrintStream | println | (String) | true | rt.jar | | sink | source |
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
| com/github/codeql/test/PublicClass.java:7:15:7:19 | stuff | com.github.codeql.test.PublicClass#stuff(String) | false | test | |
2-
| com/github/codeql/test/PublicClass.java:11:22:11:32 | staticStuff | com.github.codeql.test.PublicClass#staticStuff(String) | false | test | |
3-
| com/github/codeql/test/PublicClass.java:15:18:15:31 | protectedStuff | com.github.codeql.test.PublicClass#protectedStuff(String) | false | test | |
4-
| com/github/codeql/test/PublicClass.java:27:17:27:28 | summaryStuff | com.github.codeql.test.PublicClass#summaryStuff(String) | true | test | summary |
5-
| com/github/codeql/test/PublicClass.java:31:17:31:27 | sourceStuff | com.github.codeql.test.PublicClass#sourceStuff() | true | test | source |
6-
| com/github/codeql/test/PublicClass.java:35:15:35:23 | sinkStuff | com.github.codeql.test.PublicClass#sinkStuff(String) | true | test | sink |
7-
| com/github/codeql/test/PublicClass.java:39:15:39:26 | neutralStuff | com.github.codeql.test.PublicClass#neutralStuff(String) | true | test | neutral |
8-
| com/github/codeql/test/PublicGenericClass.java:6:15:6:19 | stuff | com.github.codeql.test.PublicGenericClass#stuff(Object) | false | test | |
9-
| com/github/codeql/test/PublicGenericClass.java:10:20:10:25 | stuff2 | com.github.codeql.test.PublicGenericClass#stuff2(Object) | false | test | |
10-
| com/github/codeql/test/PublicGenericInterface.java:4:17:4:21 | stuff | com.github.codeql.test.PublicGenericInterface#stuff(Object) | false | test | |
11-
| com/github/codeql/test/PublicGenericInterface.java:5:22:5:27 | stuff2 | com.github.codeql.test.PublicGenericInterface#stuff2(Object) | false | test | |
12-
| com/github/codeql/test/PublicGenericInterface.java:7:24:7:34 | staticStuff | com.github.codeql.test.PublicGenericInterface#staticStuff(String) | false | test | |
13-
| com/github/codeql/test/PublicInterface.java:4:17:4:21 | stuff | com.github.codeql.test.PublicInterface#stuff(String) | false | test | |
14-
| com/github/codeql/test/PublicInterface.java:6:24:6:34 | staticStuff | com.github.codeql.test.PublicInterface#staticStuff(String) | false | test | |
1+
| com/github/codeql/test/PublicClass.java:7:15:7:19 | stuff | com.github.codeql.test | PublicClass | stuff | (String) | false | test | |
2+
| com/github/codeql/test/PublicClass.java:11:22:11:32 | staticStuff | com.github.codeql.test | PublicClass | staticStuff | (String) | false | test | |
3+
| com/github/codeql/test/PublicClass.java:15:18:15:31 | protectedStuff | com.github.codeql.test | PublicClass | protectedStuff | (String) | false | test | |
4+
| com/github/codeql/test/PublicClass.java:27:17:27:28 | summaryStuff | com.github.codeql.test | PublicClass | summaryStuff | (String) | true | test | summary |
5+
| com/github/codeql/test/PublicClass.java:31:17:31:27 | sourceStuff | com.github.codeql.test | PublicClass | sourceStuff | () | true | test | source |
6+
| com/github/codeql/test/PublicClass.java:35:15:35:23 | sinkStuff | com.github.codeql.test | PublicClass | sinkStuff | (String) | true | test | sink |
7+
| com/github/codeql/test/PublicClass.java:39:15:39:26 | neutralStuff | com.github.codeql.test | PublicClass | neutralStuff | (String) | true | test | neutral |
8+
| com/github/codeql/test/PublicGenericClass.java:6:15:6:19 | stuff | com.github.codeql.test | PublicGenericClass | stuff | (Object) | false | test | |
9+
| com/github/codeql/test/PublicGenericClass.java:10:20:10:25 | stuff2 | com.github.codeql.test | PublicGenericClass | stuff2 | (Object) | false | test | |
10+
| com/github/codeql/test/PublicGenericInterface.java:4:17:4:21 | stuff | com.github.codeql.test | PublicGenericInterface | stuff | (Object) | false | test | |
11+
| com/github/codeql/test/PublicGenericInterface.java:5:22:5:27 | stuff2 | com.github.codeql.test | PublicGenericInterface | stuff2 | (Object) | false | test | |
12+
| com/github/codeql/test/PublicGenericInterface.java:7:24:7:34 | staticStuff | com.github.codeql.test | PublicGenericInterface | staticStuff | (String) | false | test | |
13+
| com/github/codeql/test/PublicInterface.java:4:17:4:21 | stuff | com.github.codeql.test | PublicInterface | stuff | (String) | false | test | |
14+
| com/github/codeql/test/PublicInterface.java:6:24:6:34 | staticStuff | com.github.codeql.test | PublicInterface | staticStuff | (String) | false | test | |

0 commit comments

Comments
 (0)