@@ -69,10 +69,10 @@ class MethodEndpoint extends Endpoint instanceof DataFlow::MethodNode {
69
69
DataFlow:: MethodNode getNode ( ) { result = this }
70
70
71
71
override string getName ( ) {
72
- result = super .getMethodName ( ) and this .isConstructor ( ) = false
72
+ result = super .getMethodName ( ) and not this .isConstructor ( )
73
73
or
74
74
// Constructors are modeled as Type!#new rather than Type#initialize
75
- result = "new" and this .isConstructor ( ) = true
75
+ result = "new" and this .isConstructor ( )
76
76
}
77
77
78
78
/**
@@ -81,13 +81,13 @@ class MethodEndpoint extends Endpoint instanceof DataFlow::MethodNode {
81
81
override string getType ( ) {
82
82
result =
83
83
any ( DataFlow:: ModuleNode m | m .getOwnInstanceMethod ( this .getName ( ) ) = this ) .getQualifiedName ( ) and
84
- this .isConstructor ( ) = false
84
+ not this .isConstructor ( )
85
85
or
86
86
// Constructors are modeled on `Type!`, not on `Type`
87
87
result =
88
88
any ( DataFlow:: ModuleNode m | m .getOwnInstanceMethod ( super .getMethodName ( ) ) = this )
89
89
.getQualifiedName ( ) + "!" and
90
- this .isConstructor ( ) = true
90
+ this .isConstructor ( )
91
91
or
92
92
result =
93
93
any ( DataFlow:: ModuleNode m | m .getOwnSingletonMethod ( this .getName ( ) ) = this )
@@ -158,12 +158,9 @@ class MethodEndpoint extends Endpoint instanceof DataFlow::MethodNode {
158
158
/**
159
159
* Holds if this method is a constructor for a module.
160
160
*/
161
- private boolean isConstructor ( ) {
162
- if
163
- super .getMethodName ( ) = "initialize" and
164
- exists ( DataFlow:: ModuleNode m | m .getOwnInstanceMethod ( super .getMethodName ( ) ) = this )
165
- then result = true
166
- else result = false
161
+ private predicate isConstructor ( ) {
162
+ super .getMethodName ( ) = "initialize" and
163
+ exists ( DataFlow:: ModuleNode m | m .getOwnInstanceMethod ( super .getMethodName ( ) ) = this )
167
164
}
168
165
}
169
166
0 commit comments