mirror of
https://github.com/github/codeql.git
synced 2026-04-26 09:15:12 +02:00
patch upper-case acronyms to be PascalCase
This commit is contained in:
@@ -49,7 +49,7 @@ predicate benignContext(Expr e) {
|
||||
e.getParent().(ExprStmt).getParent() instanceof CodeInAttribute
|
||||
or
|
||||
// and JSX-attributes.
|
||||
e = any(JSXAttribute attr).getValue()
|
||||
e = any(JsxAttribute attr).getValue()
|
||||
or
|
||||
exists(AwaitExpr await | await.getOperand() = e and benignContext(await))
|
||||
or
|
||||
|
||||
@@ -139,12 +139,12 @@ predicate whitelist(Expr e) {
|
||||
* The return value of `e` may have other uses besides the truthiness check,
|
||||
* but if the truthiness check always goes one way, it still indicates an error.
|
||||
*/
|
||||
predicate isConditional(ASTNode cond, Expr e) {
|
||||
predicate isConditional(AstNode cond, Expr e) {
|
||||
isExplicitConditional(cond, e) or
|
||||
e = cond.(LogicalBinaryExpr).getLeftOperand()
|
||||
}
|
||||
|
||||
from ASTNode cond, DataFlow::AnalyzedNode op, boolean cv, ASTNode sel, string msg
|
||||
from AstNode cond, DataFlow::AnalyzedNode op, boolean cv, AstNode sel, string msg
|
||||
where
|
||||
isConditional(cond, op.asExpr()) and
|
||||
cv = op.getTheBooleanValue() and
|
||||
|
||||
@@ -9,7 +9,7 @@ import javascript
|
||||
* `e` and checks its value for truthiness, and the return value of `e`
|
||||
* is not used for anything other than this truthiness check.
|
||||
*/
|
||||
predicate isExplicitConditional(ASTNode cond, Expr e) {
|
||||
predicate isExplicitConditional(AstNode cond, Expr e) {
|
||||
e = cond.(IfStmt).getCondition()
|
||||
or
|
||||
e = cond.(LoopStmt).getTest()
|
||||
|
||||
Reference in New Issue
Block a user