mirror of
https://github.com/hohn/codeql-javascript.git
synced 2025-12-16 22:33:05 +01:00
Added trivial graph for illustration
This commit is contained in:
committed by
=Michael Hohn
parent
4fcbe94d52
commit
1e47b5e599
22
queries/graphout.ql
Normal file
22
queries/graphout.ql
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @name simple graph test
|
||||
* @kind graph
|
||||
*/
|
||||
|
||||
import javascript
|
||||
|
||||
query predicate edges(int a, int b) {
|
||||
a = 1 and b = 2
|
||||
or
|
||||
a = 2 and b = 3
|
||||
}
|
||||
|
||||
query predicate nodes(int n, string key, string val) {
|
||||
(edges(n, _) or edges(_, n)) and
|
||||
key = "semmle.label" and
|
||||
val = n.toString()
|
||||
}
|
||||
|
||||
query predicate graphProperties(string key, string value) {
|
||||
key = "semmle.graphKind" and value = "tree"
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
name: codeql-custom-queries-javascript
|
||||
name: exploratory-queries-javascript
|
||||
version: 0.0.0
|
||||
libraryPathDependencies: codeql-javascript
|
||||
|
||||
Reference in New Issue
Block a user