Updated

app/jobs / backfill_canonical_emails_job.rb

B
20 lines of codes
1 methods
17.5 complexity/method
1 churn
17.53 complexity
43 duplications
class BackfillCanonicalEmailsJob < ApplicationJob
  1. BackfillCanonicalEmailsJob has no descriptive comment
queue_as :low_priority def perform(id = 0)
  1. Similar code found in 2 nodes Locations: 0 1
  2. BackfillCanonicalEmailsJob#perform has approx 6 statements
signatures = Signature.where(canonical_email: nil).batch(id).to_a max_id = signatures.map(&:id).max signatures.each do |signature| next if signature.canonical_email?
  1. BackfillCanonicalEmailsJob#perform refers to 'signature' more than self (maybe move it to another class?) Locations: 0 1 2
if signature.email?
  1. BackfillCanonicalEmailsJob#perform refers to 'signature' more than self (maybe move it to another class?) Locations: 0 1 2
signature.update_canonical_email
  1. BackfillCanonicalEmailsJob#perform refers to 'signature' more than self (maybe move it to another class?) Locations: 0 1 2
end end if Signature.exists?(canonical_email: nil) self.class.perform_later(max_id) end end end