@@ -33,9 +33,6 @@ predicate benignContext(Expr e) {
3333
3434 // A return statement is often used to just end the function.
3535 e = any ( Function f ) .getAReturnedExpr ( )
36- or
37- // The call is only in a non-void context because it is in a lambda.
38- e = any ( ArrowFunctionExpr arrow ) .getBody ( )
3936 or
4037 exists ( ConditionalExpr cond | cond .getABranch ( ) = e and benignContext ( cond ) )
4138 or
@@ -47,31 +44,31 @@ predicate benignContext(Expr e) {
4744 or
4845 exists ( Expr parent | parent .getUnderlyingValue ( ) = e and benignContext ( parent ) )
4946 or
50- exists ( VoidExpr voidExpr | voidExpr .getOperand ( ) = e )
47+ any ( VoidExpr voidExpr ) .getOperand ( ) = e
5148
5249 or
5350 // weeds out calls inside HTML-attributes.
54- e .getContainer ( ) instanceof CodeInAttribute or
51+ e .getParent ( ) instanceof CodeInAttribute or
5552 // and JSX-attributes.
5653 e = any ( JSXAttribute attr ) .getValue ( ) or
5754
5855 // It is ok (or to be flagged by another query?) to await a non-async function.
5956 exists ( AwaitExpr await | await .getOperand ( ) = e and benignContext ( await ) )
6057 or
6158 // Avoid double reporting with js/trivial-conditional
62- exists ( ASTNode cond | isExplicitConditional ( cond , e ) )
59+ isExplicitConditional ( _ , e )
6360 or
6461 // Avoid double reporting with js/comparison-between-incompatible-types
65- exists ( Comparison binOp | binOp .getAnOperand ( ) = e )
62+ any ( Comparison binOp ) .getAnOperand ( ) = e
6663 or
6764 // Avoid double reporting with js/property-access-on-non-object
68- exists ( PropAccess ac | ac .getBase ( ) = e )
65+ any ( PropAccess ac ) .getBase ( ) = e
6966 or
7067 // Avoid double-reporting with js/unused-local-variable
7168 exists ( VariableDeclarator v | v .getInit ( ) = e and v .getBindingPattern ( ) .getVariable ( ) instanceof UnusedLocal )
7269 or
7370 // Avoid double reporting with js/call-to-non-callable
74- exists ( InvokeExpr invoke | invoke .getCallee ( ) = e )
71+ any ( InvokeExpr invoke ) .getCallee ( ) = e
7572}
7673
7774predicate functionBlacklist ( Function f ) {
0 commit comments