mirror of
https://github.com/github/codeql.git
synced 2026-03-20 22:46:47 +01:00
remove some parentheses
This commit is contained in:
@@ -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()
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user