CFG: sort expected output by file path and line

This commit is contained in:
Arthur Baars
2021-02-25 12:23:07 +01:00
parent 87b2c142bc
commit 27a2310840
2 changed files with 468 additions and 479 deletions

View File

@@ -4,7 +4,20 @@
import codeql_ruby.CFG
query predicate nodes(CfgNode n) { any() }
query predicate nodes(CfgNode n, string attr, string val) {
attr = "semmle.order" and
val =
any(int i |
n =
rank[i](CfgNode p |
|
p
order by
p.getLocation().getFile().getBaseName(), p.getLocation().getFile().getAbsolutePath(),
p.getLocation().getStartLine()
)
).toString()
}
query predicate edges(CfgNode pred, CfgNode succ, string attr, string val) {
exists(SuccessorType t | succ = pred.getASuccessor(t) |