Commit 69124de2 authored by Arturo Herrero's avatar Arturo Herrero

Use size instead of count

count is kind of misleading, it looks like
ActiveRecord::Calculations.count
https://api.rubyonrails.org/classes/ActiveRecord/Calculations.html#method-i-count
but counts is a hash, so it uses Enumerable#count
https://ruby-doc.org/core-2.7.1/Enumerable.html#method-i-count.

From the Ruby style guide: Don’t use count as a substitute for size.
https://github.com/rubocop-hq/ruby-style-guide#count-vs-size
parent a7847eec
...@@ -376,8 +376,8 @@ module Gitlab ...@@ -376,8 +376,8 @@ module Gitlab
service_url&.include?('.atlassian.net') ? :cloud : :server service_url&.include?('.atlassian.net') ? :cloud : :server
end end
results[:projects_jira_server_active] += counts[:server].count if counts[:server] results[:projects_jira_server_active] += counts[:server].size if counts[:server]
results[:projects_jira_cloud_active] += counts[:cloud].count if counts[:cloud] results[:projects_jira_cloud_active] += counts[:cloud].size if counts[:cloud]
results[:projects_jira_active] += services.size results[:projects_jira_active] += services.size
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment