Update ql/ql/src/queries/style/ValidatePredicateGetReturns.ql

Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
This commit is contained in:
Napalys Klicius
2024-11-29 15:19:19 +01:00
committed by GitHub
parent a5521b90fc
commit 029b567bb7

View File

@@ -16,7 +16,7 @@ import codeql_ql.ast.Ast
* Identifies predicates whose names start with "get" followed by an uppercase letter.
* This ensures that only predicates like "getValue" are matched, excluding names like "getter".
*/
predicate isGetPredicate(Predicate pred) { pred.getName().regexpMatch("get[A-Z].*") }
predicate isGetPredicate(Predicate pred) { pred.getName().regexpMatch("(get|as)[A-Z].*") }
/**
* Checks if a predicate has a return type.