fix all ql/use-string-compare

This commit is contained in:
Erik Krogh Kristensen
2022-05-17 13:48:21 +02:00
parent 440e6214f0
commit 86e97c32d6
26 changed files with 62 additions and 61 deletions

View File

@@ -2286,9 +2286,7 @@ class ComprehensionExpr extends @comprehension_expr, Expr {
/** Holds if this is a legacy postfix comprehension expression. */
predicate isPostfix() {
exists(Token tk | tk = this.getFirstToken().getNextToken() |
not tk.getValue().regexpMatch("if|for")
)
exists(Token tk | tk = this.getFirstToken().getNextToken() | not tk.getValue() = ["if", "for"])
}
override string getAPrimaryQlClass() { result = "ComprehensionExpr" }

View File

@@ -19,7 +19,7 @@ private predicate xUnitDetected() {
private predicate possiblyAttribute(Expr e, string name) {
exists(Identifier id | id = e or id = e.(CallExpr).getCallee() |
name = id.getName() and
name.regexpMatch("Async|Data|Fact|Fixture|Import|ImportJson|Skip|Trait")
name = ["Async", "Data", "Fact", "Fixture", "Import", "ImportJson", "Skip", "Trait"]
)
}