@@ -29,6 +29,10 @@ module ActionCable {
29
29
}
30
30
}
31
31
32
+ private DataFlow:: ConstRef getActionCableChannelBase ( ) {
33
+ result = DataFlow:: getConstant ( "ActionCable" ) .getConstant ( "Channel" ) .getConstant ( "Base" )
34
+ }
35
+
32
36
/**
33
37
* The data argument in an RPC endpoint method on a subclass of
34
38
* `ActionCable::Channel::Base`, considered as a remote flow source.
@@ -38,21 +42,11 @@ module ActionCable {
38
42
exists ( DataFlow:: MethodNode m |
39
43
// Any method on a subclass of `ActionCable::Channel::Base`
40
44
// automatically becomes an RPC endpoint
41
- m =
42
- DataFlow:: getConstant ( "ActionCable" )
43
- .getConstant ( "Channel" )
44
- .getConstant ( "Base" )
45
- .getADescendentModule ( )
46
- .getAnInstanceMethod ( ) and
45
+ m = getActionCableChannelBase ( ) .getADescendentModule ( ) .getAnInstanceMethod ( ) and
47
46
// as long as it's not an instance method of
48
47
// `ActionCable::Channel::Base` itself, which might exist in the
49
48
// database
50
- not m =
51
- DataFlow:: getConstant ( "ActionCable" )
52
- .getConstant ( "Channel" )
53
- .getConstant ( "Base" )
54
- .asModule ( )
55
- .getAnInstanceMethod ( ) and
49
+ not m = getActionCableChannelBase ( ) .asModule ( ) .getAnInstanceMethod ( ) and
56
50
// and as long as it's public
57
51
m .asCallableAstNode ( ) .isPublic ( ) and
58
52
// and is not called `subscribed` or `unsubscribed`.
0 commit comments