From e5290f3bb0437313eb4ed6c252c6bb0d5b227cdf Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Wed, 2 Oct 2019 14:51:47 +0200 Subject: [PATCH] remove some parentheses --- .../SuspiciousMethodNameDeclaration.ql | 34 ++++++++----------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/javascript/ql/src/Declarations/SuspiciousMethodNameDeclaration.ql b/javascript/ql/src/Declarations/SuspiciousMethodNameDeclaration.ql index ffa2801792c..f95bc1cad89 100644 --- a/javascript/ql/src/Declarations/SuspiciousMethodNameDeclaration.ql +++ b/javascript/ql/src/Declarations/SuspiciousMethodNameDeclaration.ql @@ -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() ) )