Use readble format for APIs

This commit is contained in:
Benjamin Muskalla
2021-09-03 11:53:18 +02:00
parent 4b02e266fd
commit 9ed14b438e
9 changed files with 16 additions and 16 deletions

View File

@@ -16,10 +16,10 @@ class ExternalAPI extends Callable {
/** /**
* Gets information about the external API in the form expected by the CSV modeling framework. * Gets information about the external API in the form expected by the CSV modeling framework.
*/ */
string asCsv(ExternalAPI api) { string asHumanReadbleString(ExternalAPI api) {
result = result =
api.getDeclaringType().getPackage() + ";?;" + api.getDeclaringType().getSourceDeclaration() + api.getDeclaringType().getPackage() + "." + api.getDeclaringType().getSourceDeclaration() +
";" + api.getName() + ";" + paramsString(api) "#" + api.getName() + paramsString(api)
} }
/** Holds if this API is not yet supported by existing CodeQL libraries */ /** Holds if this API is not yet supported by existing CodeQL libraries */

View File

@@ -20,4 +20,4 @@ where
c.getCallee().getSourceDeclaration() = api and c.getCallee().getSourceDeclaration() = api and
not c.getFile() instanceof GeneratedFile not c.getFile() instanceof GeneratedFile
) )
select api.asCsv(api) as csv, usages order by usages desc select api.asHumanReadbleString(api) as apiname, usages order by usages desc

View File

@@ -20,4 +20,4 @@ where
c.getCallee().getSourceDeclaration() = api and c.getCallee().getSourceDeclaration() = api and
not c.getFile() instanceof GeneratedFile not c.getFile() instanceof GeneratedFile
) )
select api.asCsv(api) as csv, usages order by usages desc select api.asHumanReadbleString(api) as apiname, usages order by usages desc

View File

@@ -20,4 +20,4 @@ where
c.getCallee().getSourceDeclaration() = api and c.getCallee().getSourceDeclaration() = api and
not c.getFile() instanceof GeneratedFile not c.getFile() instanceof GeneratedFile
) )
select api.asCsv(api) as csv, usages order by usages desc select api.asHumanReadbleString(api) as apiname, usages order by usages desc

View File

@@ -20,4 +20,4 @@ where
c.getCallee().getSourceDeclaration() = api and c.getCallee().getSourceDeclaration() = api and
not c.getFile() instanceof GeneratedFile not c.getFile() instanceof GeneratedFile
) )
select api.asCsv(api) as csv, usages order by usages desc select api.asHumanReadbleString(api) as apiname, usages order by usages desc

View File

@@ -1,2 +1,2 @@
| java.io;?;FileWriter;FileWriter;(File) | 1 | | java.io.FileWriter#FileWriter(File) | 1 |
| java.net;?;URL;openStream;() | 1 | | java.net.URL#openStream() | 1 |

View File

@@ -1 +1 @@
| java.net;?;URLConnection;getInputStream;() | 1 | | java.net.URLConnection#getInputStream() | 1 |

View File

@@ -1,2 +1,2 @@
| java.lang;?;StringBuilder;append;(String) | 1 | | java.lang.StringBuilder#append(String) | 1 |
| java.lang;?;StringBuilder;toString;() | 1 | | java.lang.StringBuilder#toString() | 1 |

View File

@@ -1,4 +1,4 @@
| java.io;?;PrintStream;println;(Object) | 3 | | java.io.PrintStream#println(Object) | 3 |
| java.lang;?;Object;Object;() | 2 | | java.lang.Object#Object() | 2 |
| java.lang;?;String;length;() | 1 | | java.lang.String#length() | 1 |
| java.time;?;Duration;ofMillis;(long) | 1 | | java.time.Duration#ofMillis(long) | 1 |