Skip to content

Commit e368b8f

Browse files
committed
Add classes and predicates to StructuredLogs
1 parent 48bf15f commit e368b8f

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

ql/ql/src/codeql_ql/StructuredLogs.qll

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,31 @@ module KindPredicatesLog {
269269
then result = this.getPredicateName()
270270
else result = "<Summary event>"
271271
}
272+
273+
RA getRA() { result = this.getObject("ra") }
274+
}
275+
276+
class PipeLine extends Array {
277+
RA ra;
278+
string raReference;
279+
280+
RA getRA() { result = ra }
281+
282+
string getRAReference() { result = raReference }
283+
284+
PipeLine() { this = ra.getArray(raReference) }
285+
286+
string getLineOfRA(int n) { result = this.getString(n) }
287+
}
288+
289+
class RA extends Object {
290+
SummaryEvent evt;
291+
292+
SummaryEvent getEvent() { result = evt }
293+
294+
RA() { evt.getObject("ra") = this }
295+
296+
PipeLine getPipeLine(string name) { result = this.getArray(name) }
272297
}
273298

274299
class SentinelEmpty extends SummaryEvent {
@@ -284,6 +309,17 @@ module KindPredicatesLog {
284309

285310
string getRAReference() { result = this.getString("raReference") }
286311

312+
PipeLine getPipeLine() {
313+
exists(SummaryEvent evt | runs.getEvent() = evt |
314+
result = evt.getRA().getPipeLine(pragma[only_bind_into](this.getRAReference()))
315+
)
316+
}
317+
318+
float getCount(int i, string raLine) {
319+
result = this.getCount(i) and
320+
raLine = this.getPipeLine().getLineOfRA(pragma[only_bind_into](i))
321+
}
322+
287323
float getCount(int i) { result = getRanked(this.getArray("counts"), i) }
288324

289325
float getDuplicationPercentage(int i) {

0 commit comments

Comments
 (0)