mirror of
https://github.com/github/codeql.git
synced 2026-02-08 03:01:10 +01:00
add query to detect uses of getAQlClass
This commit is contained in:
22
ql/src/queries/performance/DontUseGetAQlClass.ql
Normal file
22
ql/src/queries/performance/DontUseGetAQlClass.ql
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @name Don't use getAQlClass.
|
||||
* @description Any use of getAQlClass causes both compile-time and runtime to be significantly slower.
|
||||
* @kind problem
|
||||
* @problem.severity warning
|
||||
* @id ql/dont-use-getAQlClass
|
||||
* @tags performance
|
||||
* @precision very-high
|
||||
*/
|
||||
|
||||
import ql
|
||||
|
||||
from Call call
|
||||
where
|
||||
(
|
||||
call.(PredicateCall).getPredicateName() = "getAQlClass" or
|
||||
call.(MemberCall).getMemberName() = "getAQlClass"
|
||||
) and
|
||||
not call.getLocation().getFile().getAbsolutePath().matches("%/" + ["meta", "test"] + "/%") and
|
||||
not call.getLocation().getFile().getBaseName().toLowerCase() =
|
||||
["consistency.ql", "test.ql", "tst.ql", "tests.ql"]
|
||||
select call, "Don't use .getAQlClass"
|
||||
Reference in New Issue
Block a user