mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Modified comments to reflect 'as' changes
This commit is contained in:
@@ -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].*") }
|
||||||
|
|||||||
Reference in New Issue
Block a user