mirror of
https://github.com/github/codeql.git
synced 2026-05-03 20:58:03 +02:00
ruby: clean up logic and add test
use the CFG more than the AST
This commit is contained in:
@@ -42,6 +42,14 @@ class DatabaseQueryInLoopTest
|
||||
end
|
||||
end
|
||||
|
||||
# more complicated condition
|
||||
names.map do |name|
|
||||
user = User.where(login: name).pluck(:id).first
|
||||
unless cond && user
|
||||
raise Error.new("User '#{name}' not found")
|
||||
end
|
||||
end
|
||||
|
||||
# skipping through the loop when users are not relevant
|
||||
names.map do |name|
|
||||
user = User.where(login: name).pluck(:id).first
|
||||
|
||||
Reference in New Issue
Block a user