@@ -100,7 +100,9 @@ module FabricV2 {
100100 * calls, or a special parameter that will be set when functions are called by an external
101101 * library.
102102 */
103- abstract class Instance extends DataFlow:: LocalSourceNode { }
103+ abstract class Instance extends API:: Node {
104+ override string toString ( ) { result = "a fabric connection instance" }
105+ }
104106
105107 /**
106108 * A reference to the `fabric.connection.Connection` class.
@@ -111,7 +113,7 @@ module FabricV2 {
111113 [
112114 fabric ( ) .getMember ( "Connection" ) , connection ( ) .getMember ( "Connection" ) ,
113115 ModelOutput:: getATypeNode ( "fabric.connection.Connection~Subclass" ) .getASubclass * ( )
114- ] .getACall ( )
116+ ] .getReturn ( )
115117 }
116118 }
117119
@@ -125,7 +127,7 @@ module FabricV2 {
125127 * - https://docs.fabfile.org/en/2.5/api/connection.html#fabric.connection.Connection.local
126128 */
127129 API:: CallNode instanceRunMethods ( ) {
128- result = any ( Instance is ) .getAMethodCall ( [ "run" , "sudo" , "local" ] )
130+ result = any ( Instance is ) .getMember ( [ "run" , "sudo" , "local" ] ) . getACall ( )
129131 }
130132 }
131133 }
@@ -155,7 +157,11 @@ module FabricV2 {
155157 */
156158 private class FabricConnectionProxyCommand extends SystemCommandExecution:: Range , API:: CallNode {
157159 FabricConnectionProxyCommand ( ) {
158- this instanceof Fabric:: Connection:: ConnectionClass:: Instance and
160+ this =
161+ [
162+ fabric ( ) .getMember ( "Connection" ) , connection ( ) .getMember ( "Connection" ) ,
163+ ModelOutput:: getATypeNode ( "fabric.connection.Connection~Subclass" ) .getASubclass * ( )
164+ ] .getACall ( ) and
159165 // we want to make sure that the connection is established otherwise the command of proxy_command won't run.
160166 exists (
161167 this .getAMethodCall ( [
@@ -185,14 +191,10 @@ module FabricV2 {
185191 API:: Node test ( ) { result in [ tasks ( ) .getMember ( "task" ) , fabric ( ) .getMember ( "task" ) ] }
186192 }
187193
188- class FabricTaskFirstParamConnectionInstance extends Fabric:: Connection:: ConnectionClass:: Instance ,
189- DataFlow:: ParameterNode
194+ class FabricTaskFirstParamConnectionInstance extends Fabric:: Connection:: ConnectionClass:: Instance
190195 {
191196 FabricTaskFirstParamConnectionInstance ( ) {
192- exists ( Function func |
193- func .getADecorator ( ) = Fabric:: Tasks:: task ( ) .getAValueReachableFromSource ( ) .asExpr ( ) and
194- this .getParameter ( ) = func .getArg ( 0 )
195- )
197+ this = Fabric:: Tasks:: task ( ) .getParameter ( 0 ) .getParameter ( 0 )
196198 }
197199 }
198200
0 commit comments