Updated

spec/mailers/previews/archived / petition_mailer_preview.rb

C
77 lines of codes
10 methods
5.9 complexity/method
4 churn
59.21 complexity
68 duplications
# Preview all emails at http://localhost:3000/rails/mailers/archived/petition_mailer module Archived class PetitionMailerPreview < ActionMailer::Preview
  1. Archived::PetitionMailerPreview has no descriptive comment
def email_signer
  1. Archived::PetitionMailerPreview#email_signer doesn't depend on instance state (maybe move it to another class?)
email = Archived::Petition::Email.last petition = email.petition signature = petition.signatures.validated.last PetitionMailer.email_signer(petition, signature, email) end def email_creator
  1. Archived::PetitionMailerPreview#email_creator doesn't depend on instance state (maybe move it to another class?)
email = Archived::Petition::Email.last petition = email.petition signature = petition.creator PetitionMailer.email_creator(petition, signature, email) end def notify_signer_of_threshold_response
  1. Similar code found in 4 nodes Locations: 0 1 2 3
  2. Archived::PetitionMailerPreview#notify_signer_of_threshold_response doesn't depend on instance state (maybe move it to another class?)
petition = Archived::Petition.with_response.last signature = petition.signatures.validated.last Archived::PetitionMailer.notify_signer_of_threshold_response(petition, signature) end def notify_creator_of_threshold_response
  1. Archived::PetitionMailerPreview#notify_creator_of_threshold_response doesn't depend on instance state (maybe move it to another class?)
petition = Archived::Petition.with_response.last signature = petition.creator Archived::PetitionMailer.notify_creator_of_threshold_response(petition, signature) end def notify_signer_of_debate_scheduled
  1. Similar code found in 4 nodes Locations: 0 1 2 3
  2. Archived::PetitionMailerPreview#notify_signer_of_debate_scheduled doesn't depend on instance state (maybe move it to another class?)
petition = Archived::Petition.debated.last signature = petition.signatures.validated.last Archived::PetitionMailer.notify_signer_of_debate_scheduled(petition, signature) end def notify_creator_of_debate_scheduled
  1. Archived::PetitionMailerPreview#notify_creator_of_debate_scheduled doesn't depend on instance state (maybe move it to another class?)
petition = Archived::Petition.debated.last signature = petition.creator Archived::PetitionMailer.notify_creator_of_debate_scheduled(petition, signature) end def notify_signer_of_positive_debate_outcome
  1. Similar code found in 4 nodes Locations: 0 1 2 3
  2. Archived::PetitionMailerPreview#notify_signer_of_positive_debate_outcome doesn't depend on instance state (maybe move it to another class?)
petition = Archived::Petition.debated.last signature = petition.signatures.validated.last Archived::PetitionMailer.notify_signer_of_debate_outcome(petition, signature) end def notify_creator_of_positive_debate_outcome
  1. Archived::PetitionMailerPreview#notify_creator_of_positive_debate_outcome doesn't depend on instance state (maybe move it to another class?)
petition = Archived::Petition.debated.last signature = petition.creator Archived::PetitionMailer.notify_creator_of_debate_outcome(petition, signature) end def notify_signer_of_negative_debate_outcome
  1. Similar code found in 4 nodes Locations: 0 1 2 3
  2. Archived::PetitionMailerPreview#notify_signer_of_negative_debate_outcome doesn't depend on instance state (maybe move it to another class?)
petition = Archived::Petition.not_debated.last signature = petition.signatures.validated.last Archived::PetitionMailer.notify_signer_of_debate_outcome(petition, signature) end def notify_creator_of_negative_debate_outcome
  1. Archived::PetitionMailerPreview#notify_creator_of_negative_debate_outcome doesn't depend on instance state (maybe move it to another class?)
petition = Archived::Petition.not_debated.last signature = petition.creator Archived::PetitionMailer.notify_creator_of_debate_outcome(petition, signature) end end end