mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
apply suggestions from code review
This commit is contained in:
@@ -14,7 +14,7 @@ import DataFlow::PathGraph
|
||||
/**
|
||||
* Gets the name of an unescaped placeholder in a lodash template.
|
||||
*
|
||||
* For example, the string "<h1><%= title %></h1>" contains the placeholder "title".
|
||||
* For example, the string `"<h1><%= title %></h1>"` contains the placeholder "title".
|
||||
*/
|
||||
bindingset[s]
|
||||
string getAPlaceholderInString(string s) {
|
||||
|
||||
@@ -42,7 +42,8 @@ private string getAMentionedNonParameter(Predicate p) {
|
||||
) and
|
||||
result.regexpMatch("^[a-z]\\w+$") and
|
||||
not result.toLowerCase() = getAParameterName(p).toLowerCase() and
|
||||
not result = ["true", "false", "NaN", "this"] and // keywords
|
||||
not result = ["true", "false", "NaN", "this", "forall", "exists", "null", "break", "return"] and // keywords
|
||||
not result = any(Aggregate a).getKind() and // min, max, sum, count, etc.
|
||||
not result = getMentionedPredicates(p.getLocation().getFile()) and
|
||||
// variables inside the predicate are also fine
|
||||
not result = any(VarDecl var | var.getEnclosingPredicate() = p).getName()
|
||||
|
||||
Reference in New Issue
Block a user