Skip to content

Commit e5290f3

Browse files
committed
remove some parentheses
1 parent 22aac8e commit e5290f3

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

javascript/ql/src/Declarations/SuspiciousMethodNameDeclaration.ql

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,30 +34,26 @@ where
3434

3535
// Cases to ignore.
3636
not (
37-
( // Assume that a "new" method is intentional if the class has an explicit constructor.
38-
name = "new" and
39-
container instanceof ClassDefinition and
40-
exists(ConstructorDeclaration constructor |
41-
container.getMember("constructor") = constructor and
42-
not constructor.isSynthetic()
43-
)
44-
)
37+
// Assume that a "new" method is intentional if the class has an explicit constructor.
38+
name = "new" and
39+
container instanceof ClassDefinition and
40+
exists(ConstructorDeclaration constructor |
41+
container.getMember("constructor") = constructor and
42+
not constructor.isSynthetic()
43+
)
4544
or
46-
( // Explicitly declared static methods are fine.
47-
container instanceof ClassDefinition and
48-
member.isStatic()
49-
)
45+
// Explicitly declared static methods are fine.
46+
container instanceof ClassDefinition and
47+
member.isStatic()
5048
or
5149
// Only looking for declared methods. Methods with a body are OK.
5250
exists(member.getBody().getBody())
53-
5451
or
55-
( // The developer was not confused about "function" when there are other methods in the interface.
56-
name = "function" and
57-
exists(MethodDeclaration other | other = container.getAMethod() |
58-
name != "function" and
59-
not other.(ConstructorDeclaration).isSynthetic()
60-
)
52+
// The developer was not confused about "function" when there are other methods in the interface.
53+
name = "function" and
54+
exists(MethodDeclaration other | other = container.getAMethod() |
55+
name != "function" and
56+
not other.(ConstructorDeclaration).isSynthetic()
6157
)
6258
)
6359

0 commit comments

Comments
 (0)