lib/tasks/rabid.rake
Block has too many lines. [49/25] Open
Open
namespace :rabid do
desc 'Merges users who have multiple accounts on same email address.'
task fixup_duplicate_users: :environment do
all_emails = User.select(:email).all.map(&:email)
log("There are #{all_emails.count} accounts in the system")
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Assignment Branch Condition size for change_has_many is too high. [20.1/15] Open
Open
def change_has_many(instances, from_user, to_user)
log("User #{from_user.id} is referenced from the following model ids: #{instances.map(&:id)}")
instances.each do |instance|
log("Editing #{instance.id} to replace User #{from_user.id}) with User #{to_user.id} ")
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric