Skip to content

Commit a3a099c

Browse files
committed
QL: Add a few more methods
Still need to implement something to encapsulate RA, link it up, etc.
1 parent 729563c commit a3a099c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ql/ql/src/codeql_ql/StructuredLogs.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class Object extends JSON::Object {
1616

1717
Array getArray(string key) { result = this.getValue(key) }
1818

19+
Object getObject(string key) { result = this.getValue(key) }
20+
1921
string getType() { result = this.getString("type") }
2022

2123
int getEventId() { result = this.getNumber("event_id") }
@@ -29,6 +31,8 @@ class Array extends JSON::Array {
2931
string getString(int i) { result = this.getChild(i).(JSON::String).getChild().getValue() }
3032

3133
int getNumber(int i) { result = this.getChild(i).(JSON::Number).getValue().toInt() }
34+
35+
Array getArray(int i) { result = this.getChild(i) }
3236
}
3337

3438
abstract class LogEntry extends Object { }
@@ -63,6 +67,8 @@ class PredicateStarted extends LogEntry {
6367
string getRAHash() { result = this.getString("raHash") }
6468

6569
Object getRA() { result = this.getValue("ra") }
70+
71+
string getDependency(string key) { result = this.getObject("dependencies").getString(key) }
6672
}
6773

6874
class PipelineStarted extends LogEntry {

0 commit comments

Comments
 (0)