mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
Merge pull request #11487 from jcogs33/jcogs33/supportedexternalapis-telemetry-query
Java/C#: add SupportedExternalApis telemetry query
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
| java.io.File#File(String) | 2 |
|
||||
| java.net.URL#URL(String) | 2 |
|
||||
| java.io.FileWriter#FileWriter(File) | 1 |
|
||||
| java.lang.StringBuilder#append(String) | 1 |
|
||||
| java.lang.StringBuilder#toString() | 1 |
|
||||
| java.net.URL#openConnection() | 1 |
|
||||
| java.net.URL#openStream() | 1 |
|
||||
| java.net.URLConnection#getInputStream() | 1 |
|
||||
| java.util.Map#put(Object,Object) | 1 |
|
||||
| org.apache.commons.io.FileUtils#deleteDirectory(File) | 1 |
|
||||
@@ -0,0 +1,29 @@
|
||||
import java.time.Duration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
class SupportedExternalApis {
|
||||
public static void main(String[] args) throws Exception {
|
||||
StringBuilder builder = new StringBuilder(); // uninteresting (parameterless constructor)
|
||||
builder.append("foo"); // supported summary
|
||||
builder.toString(); // supported summary
|
||||
|
||||
Map<String, Object> map = new HashMap<>(); // uninteresting (parameterless constructor)
|
||||
map.put("foo", new Object()); // supported summary
|
||||
|
||||
Duration d = java.time.Duration.ofMillis(1000); // not supported
|
||||
|
||||
URL github = new URL("https://www.github.com/"); // supported summary
|
||||
InputStream stream = github.openConnection().getInputStream(); // supported source (getInputStream), supported sink (openConnection)
|
||||
|
||||
new FileWriter(new File("foo")); // supported sink (FileWriter), supported summary (File)
|
||||
new URL("http://foo").openStream(); // supported sink (openStream), supported summary (URL)
|
||||
|
||||
FileUtils.deleteDirectory(new File("foo")); // supported negative summary (deleteDirectory), supported summary (File)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
Telemetry/SupportedExternalApis.ql
|
||||
Reference in New Issue
Block a user