Skip to content

Commit af0c32c

Browse files
tausbnRasmusWL
andauthored
Python: Apply suggestions from code review
Co-authored-by: Rasmus Wriedt Larsen <[email protected]>
1 parent 7f131c1 commit af0c32c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

python/ql/src/semmle/python/frameworks/Fabric.qll

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ private module FabricV2 {
8383
module Connection {
8484
/** Gets a reference to the `fabric.connection.Connection` class. */
8585
API::Node classRef() {
86-
result in [fabric().getMember("Connection"), connection().getMember("Connection")]
86+
result = fabric().getMember("Connection")
87+
or
88+
result = connection().getMember("Connection")
8789
}
8890

8991
/**
@@ -110,7 +112,7 @@ private module FabricV2 {
110112
}
111113

112114
/** Gets a reference to an instance of `fabric.connection.Connection`. */
113-
DataFlow::LocalSourceNode instance() { result = instance(DataFlow::TypeTracker::end()) }
115+
DataFlow::Node instance() { instance(DataFlow::TypeTracker::end()).flowsTo(result) }
114116

115117
/**
116118
* Gets a reference to either `run`, `sudo`, or `local` method on a
@@ -249,7 +251,9 @@ private module FabricV2 {
249251
module SerialGroup {
250252
private class ClassInstantiation extends Group::ModeledSubclass {
251253
ClassInstantiation() {
252-
this in [group().getMember("SerialGroup"), fabric().getMember("SerialGroup")]
254+
this = group().getMember("SerialGroup")
255+
or
256+
this = fabric().getMember("SerialGroup")
253257
}
254258
}
255259
}
@@ -262,7 +266,9 @@ private module FabricV2 {
262266
module ThreadingGroup {
263267
private class ClassInstantiation extends Group::ModeledSubclass {
264268
ClassInstantiation() {
265-
this in [group().getMember("ThreadingGroup"), fabric().getMember("ThreadingGroup")]
269+
this = group().getMember("ThreadingGroup")
270+
or
271+
this = fabric().getMember("ThreadingGroup")
266272
}
267273
}
268274
}

0 commit comments

Comments
 (0)