Skip to content

Commit f1601d6

Browse files
committed
Python: autoformat
1 parent 1d9c3b3 commit f1601d6

File tree

3 files changed

+24
-26
lines changed

3 files changed

+24
-26
lines changed

python/tools/recorded-call-graph-metrics/ql/PointsToFound.ql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import RecordedCalls
22

33
from ValidRecordedCall rc, Call call, Function callee, CallableValue calleeValue
44
where
5-
call = rc.getCall() and
6-
callee = rc.getCallee() and
7-
calleeValue.getScope() = callee and
8-
calleeValue.getACall() = call.getAFlowNode()
5+
call = rc.getCall() and
6+
callee = rc.getCallee() and
7+
calleeValue.getScope() = callee and
8+
calleeValue.getACall() = call.getAFlowNode()
99
select call, "-->", callee
Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,36 @@
11
import python
22

33
class RecordedCall extends XMLElement {
4-
RecordedCall() {
5-
this.hasName("recorded_call")
6-
}
4+
RecordedCall() { this.hasName("recorded_call") }
75

8-
string call_filename() { result = this.getAttributeValue("call_filename") }
6+
string call_filename() { result = this.getAttributeValue("call_filename") }
97

10-
int call_linenum() { result = this.getAttributeValue("call_linenum").toInt() }
8+
int call_linenum() { result = this.getAttributeValue("call_linenum").toInt() }
119

12-
int call_inst_index() { result = this.getAttributeValue("call_inst_index").toInt() }
10+
int call_inst_index() { result = this.getAttributeValue("call_inst_index").toInt() }
1311

14-
Call getCall() {
15-
// TODO: handle calls spanning multiple lines
16-
result.getLocation().hasLocationInfo(this.call_filename(), this.call_linenum(), _, _, _)
17-
}
12+
Call getCall() {
13+
// TODO: handle calls spanning multiple lines
14+
result.getLocation().hasLocationInfo(this.call_filename(), this.call_linenum(), _, _, _)
15+
}
1816

19-
string callee_filename() { result = this.getAttributeValue("callee_filename") }
17+
string callee_filename() { result = this.getAttributeValue("callee_filename") }
2018

21-
int callee_linenum() { result = this.getAttributeValue("callee_linenum").toInt() }
19+
int callee_linenum() { result = this.getAttributeValue("callee_linenum").toInt() }
2220

23-
string callee_funcname() { result = this.getAttributeValue("callee_funcname") }
21+
string callee_funcname() { result = this.getAttributeValue("callee_funcname") }
2422

25-
Function getCallee() {
26-
result.getLocation().hasLocationInfo(this.callee_filename(), this.callee_linenum(), _, _, _)
27-
}
23+
Function getCallee() {
24+
result.getLocation().hasLocationInfo(this.callee_filename(), this.callee_linenum(), _, _, _)
25+
}
2826
}
2927

3028
/**
3129
* Class of recorded calls where we can uniquely identify both the `call` and the `callee`.
3230
*/
3331
class ValidRecordedCall extends RecordedCall {
34-
ValidRecordedCall() {
35-
strictcount(this.getCall()) = 1 and
36-
strictcount(this.getCallee()) = 1
37-
}
32+
ValidRecordedCall() {
33+
strictcount(this.getCall()) = 1 and
34+
strictcount(this.getCallee()) = 1
35+
}
3836
}

python/tools/recorded-call-graph-metrics/ql/UnidentifiedRecordedCalls.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ import RecordedCalls
33
from RecordedCall rc
44
where not rc instanceof ValidRecordedCall
55
select "Could not uniquely identify this recorded call (either call or callee was not uniquely identified)",
6-
rc.call_filename(), rc.call_linenum(), rc.call_inst_index(), "-->", rc.callee_filename(),
7-
rc.callee_linenum(), rc.callee_funcname()
6+
rc.call_filename(), rc.call_linenum(), rc.call_inst_index(), "-->", rc.callee_filename(),
7+
rc.callee_linenum(), rc.callee_funcname()

0 commit comments

Comments
 (0)