remove some parentheses

This commit is contained in:
Erik Krogh Kristensen
2019-10-02 14:51:47 +02:00
parent 22aac8e723
commit e5290f3bb0

View File

@@ -34,30 +34,26 @@ where
// Cases to ignore.
not (
( // Assume that a "new" method is intentional if the class has an explicit constructor.
name = "new" and
container instanceof ClassDefinition and
exists(ConstructorDeclaration constructor |
container.getMember("constructor") = constructor and
not constructor.isSynthetic()
)
)
// Assume that a "new" method is intentional if the class has an explicit constructor.
name = "new" and
container instanceof ClassDefinition and
exists(ConstructorDeclaration constructor |
container.getMember("constructor") = constructor and
not constructor.isSynthetic()
)
or
( // Explicitly declared static methods are fine.
container instanceof ClassDefinition and
member.isStatic()
)
// Explicitly declared static methods are fine.
container instanceof ClassDefinition and
member.isStatic()
or
// Only looking for declared methods. Methods with a body are OK.
exists(member.getBody().getBody())
or
( // The developer was not confused about "function" when there are other methods in the interface.
name = "function" and
exists(MethodDeclaration other | other = container.getAMethod() |
name != "function" and
not other.(ConstructorDeclaration).isSynthetic()
)
// The developer was not confused about "function" when there are other methods in the interface.
name = "function" and
exists(MethodDeclaration other | other = container.getAMethod() |
name != "function" and
not other.(ConstructorDeclaration).isSynthetic()
)
)