Sample of generation of dot graph from javascript source

This commit is contained in:
Michael Hohn
2021-08-14 20:31:56 -07:00
committed by =Michael Hohn
commit 1aa6e6feb4
8 changed files with 590 additions and 0 deletions

17
queries/printast.ql Normal file
View File

@@ -0,0 +1,17 @@
/**
* @name Print AST
* @kind graph
*/
import javascript
import semmle.javascript.PrintAst
class PrintAstConfigurationOverride extends PrintAstConfiguration {
override predicate shouldPrint(Locatable e, Location l) {
super.shouldPrint(e, l) and
l.getFile().getBaseName() = "callbacks.js"
}
}
// from File f
// where f.getBaseName() = "callbacks.js"
// select f

3
queries/qlpack.yml Normal file
View File

@@ -0,0 +1,3 @@
name: codeql-custom-queries-javascript
version: 0.0.0
libraryPathDependencies: codeql-javascript

1
queries/queries.xml Normal file
View File

@@ -0,0 +1 @@
<queries language="javascript"/>