mirror of
https://github.com/github/codeql.git
synced 2026-02-20 08:53:49 +01:00
CFG: sort expected output by file path and line
This commit is contained in:
@@ -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) |
|
||||
|
||||
Reference in New Issue
Block a user