mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
ruby: use inline expectation tests
This commit is contained in:
@@ -1 +1,2 @@
|
||||
queries/performance/DatabaseQueryInLoop.ql
|
||||
query: queries/performance/DatabaseQueryInLoop.ql
|
||||
postprocess: utils/test/InlineExpectationsTestQuery.ql
|
||||
@@ -8,15 +8,15 @@ class DatabaseQueryInLoopTest
|
||||
|
||||
# simple query in loop
|
||||
names.map do |name|
|
||||
User.where(login: name).pluck(:id).first
|
||||
User.where(login: name).pluck(:id).first # $ Alert
|
||||
end
|
||||
|
||||
# nested loop
|
||||
names.map do |name|
|
||||
user = User.where(login: name).pluck(:id).first
|
||||
user = User.where(login: name).pluck(:id).first # $ Alert
|
||||
|
||||
ids.map do |user_id|
|
||||
User.where(id: user_id).pluck(:id).first
|
||||
User.where(id: user_id).pluck(:id).first # $ Alert
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user