@@ -23,28 +23,16 @@ private module FabricV1 {
23
23
/** Gets a reference to the `fabric` module. */
24
24
API:: Node fabric ( ) { result = API:: moduleImport ( "fabric" ) }
25
25
26
- /**
27
- * Gets a reference to the attribute `attr_name` of the `fabric` module.
28
- * WARNING: Only holds for a few predefined attributes.
29
- */
30
- private API:: Node fabric_attr ( string attr_name ) { result = fabric ( ) .getMember ( attr_name ) }
31
-
32
26
/** Provides models for the `fabric` module. */
33
27
module fabric {
34
28
// -------------------------------------------------------------------------
35
29
// fabric.api
36
30
// -------------------------------------------------------------------------
37
31
/** Gets a reference to the `fabric.api` module. */
38
- API:: Node api ( ) { result = fabric_attr ( "api" ) }
32
+ API:: Node api ( ) { result = fabric ( ) . getMember ( "api" ) }
39
33
40
34
/** Provides models for the `fabric.api` module */
41
35
module api {
42
- /**
43
- * Gets a reference to the attribute `attr_name` of the `fabric.api` module.
44
- * WARNING: Only holds for a few predefined attributes.
45
- */
46
- private API:: Node api_attr ( string attr_name ) { result = api ( ) .getMember ( attr_name ) }
47
-
48
36
/**
49
37
* A call to either
50
38
* - `fabric.api.local`
@@ -57,7 +45,7 @@ private module FabricV1 {
57
45
*/
58
46
private class FabricApiLocalRunSudoCall extends SystemCommandExecution:: Range ,
59
47
DataFlow:: CallCfgNode {
60
- FabricApiLocalRunSudoCall ( ) { this = api_attr ( [ "local" , "run" , "sudo" ] ) .getACall ( ) }
48
+ FabricApiLocalRunSudoCall ( ) { this = api ( ) . getMember ( [ "local" , "run" , "sudo" ] ) .getACall ( ) }
61
49
62
50
override DataFlow:: Node getCommand ( ) {
63
51
result .asCfgNode ( ) = [ node .getArg ( 0 ) , node .getArgByName ( "command" ) ]
@@ -77,30 +65,16 @@ private module FabricV2 {
77
65
/** Gets a reference to the `fabric` module. */
78
66
API:: Node fabric ( ) { result = API:: moduleImport ( "fabric" ) }
79
67
80
- /**
81
- * Gets a reference to the attribute `attr_name` of the `fabric` module.
82
- * WARNING: Only holds for a few predefined attributes.
83
- */
84
- private API:: Node fabric_attr ( string attr_name ) { result = fabric ( ) .getMember ( attr_name ) }
85
-
86
68
/** Provides models for the `fabric` module. */
87
69
module fabric {
88
70
// -------------------------------------------------------------------------
89
71
// fabric.connection
90
72
// -------------------------------------------------------------------------
91
73
/** Gets a reference to the `fabric.connection` module. */
92
- API:: Node connection ( ) { result = fabric_attr ( "connection" ) }
74
+ API:: Node connection ( ) { result = fabric ( ) . getMember ( "connection" ) }
93
75
94
76
/** Provides models for the `fabric.connection` module */
95
77
module connection {
96
- /**
97
- * Gets a reference to the attribute `attr_name` of the `fabric.connection` module.
98
- * WARNING: Only holds for a few predefined attributes.
99
- */
100
- private API:: Node connection_attr ( string attr_name ) {
101
- result = connection ( ) .getMember ( attr_name )
102
- }
103
-
104
78
/**
105
79
* Provides models for the `fabric.connection.Connection` class
106
80
*
@@ -109,7 +83,7 @@ private module FabricV2 {
109
83
module Connection {
110
84
/** Gets a reference to the `fabric.connection.Connection` class. */
111
85
API:: Node classRef ( ) {
112
- result in [ fabric_attr ( "Connection" ) , connection_attr ( "Connection" ) ]
86
+ result in [ fabric ( ) . getMember ( "Connection" ) , connection ( ) . getMember ( "Connection" ) ]
113
87
}
114
88
115
89
/**
@@ -136,7 +110,7 @@ private module FabricV2 {
136
110
}
137
111
138
112
/** Gets a reference to an instance of `fabric.connection.Connection`. */
139
- DataFlow:: Node instance ( ) { instance ( DataFlow:: TypeTracker:: end ( ) ) . flowsTo ( result ) }
113
+ DataFlow:: LocalSourceNode instance ( ) { result = instance ( DataFlow:: TypeTracker:: end ( ) ) }
140
114
141
115
/**
142
116
* Gets a reference to either `run`, `sudo`, or `local` method on a
@@ -191,7 +165,7 @@ private module FabricV2 {
191
165
// fabric.tasks
192
166
// -------------------------------------------------------------------------
193
167
/** Gets a reference to the `fabric.tasks` module. */
194
- API:: Node tasks ( ) { result = fabric_attr ( "tasks" ) }
168
+ API:: Node tasks ( ) { result = fabric ( ) . getMember ( "tasks" ) }
195
169
196
170
/** Provides models for the `fabric.tasks` module */
197
171
module tasks {
@@ -213,16 +187,10 @@ private module FabricV2 {
213
187
// fabric.group
214
188
// -------------------------------------------------------------------------
215
189
/** Gets a reference to the `fabric.group` module. */
216
- API:: Node group ( ) { result = fabric_attr ( "group" ) }
190
+ API:: Node group ( ) { result = fabric ( ) . getMember ( "group" ) }
217
191
218
192
/** Provides models for the `fabric.group` module */
219
193
module group {
220
- /**
221
- * Gets a reference to the attribute `attr_name` of the `fabric.group` module.
222
- * WARNING: Only holds for a few predefined attributes.
223
- */
224
- private API:: Node group_attr ( string attr_name ) { result = group ( ) .getMember ( attr_name ) }
225
-
226
194
/**
227
195
* Provides models for the `fabric.group.Group` class and its subclasses.
228
196
*
@@ -280,7 +248,9 @@ private module FabricV2 {
280
248
*/
281
249
module SerialGroup {
282
250
private class ClassInstantiation extends Group:: ModeledSubclass {
283
- ClassInstantiation ( ) { this in [ group_attr ( "SerialGroup" ) , fabric_attr ( "SerialGroup" ) ] }
251
+ ClassInstantiation ( ) {
252
+ this in [ group ( ) .getMember ( "SerialGroup" ) , fabric ( ) .getMember ( "SerialGroup" ) ]
253
+ }
284
254
}
285
255
}
286
256
@@ -292,7 +262,7 @@ private module FabricV2 {
292
262
module ThreadingGroup {
293
263
private class ClassInstantiation extends Group:: ModeledSubclass {
294
264
ClassInstantiation ( ) {
295
- this in [ group_attr ( "ThreadingGroup" ) , fabric_attr ( "ThreadingGroup" ) ]
265
+ this in [ group ( ) . getMember ( "ThreadingGroup" ) , fabric ( ) . getMember ( "ThreadingGroup" ) ]
296
266
}
297
267
}
298
268
}
0 commit comments