Modified comments to reflect 'as' changes

This commit is contained in:
Napalys
2024-11-29 15:35:18 +01:00
parent e33f7aa1c7
commit 96c1086dfc

View File

@@ -1,6 +1,6 @@
/** /**
* @name Predicates starting with "get" should return a value * @name Predicates starting with "get" or "as" should return a value
* @description Checks if predicates that start with "get" actually return a value. * @description Checks if predicates that start with "get" or "as" actually return a value.
* @kind problem * @kind problem
* @problem.severity warning * @problem.severity warning
* @id ql/predicates-get-should-return-value * @id ql/predicates-get-should-return-value
@@ -13,7 +13,7 @@ import ql
import codeql_ql.ast.Ast import codeql_ql.ast.Ast
/** /**
* Identifies predicates whose names start with "get" followed by an uppercase letter. * Identifies predicates whose names start with "get", "as" followed by an uppercase letter.
* This ensures that only predicates like "getValue" are matched, excluding names like "getter". * This ensures that only predicates like "getValue" are matched, excluding names like "getter".
*/ */
predicate isGetPredicate(Predicate pred) { pred.getName().regexpMatch("(get|as)[A-Z].*") } predicate isGetPredicate(Predicate pred) { pred.getName().regexpMatch("(get|as)[A-Z].*") }