CSC/ECE 517 Fall 2021 - E2144. Refactor delayed mailer and scheduled task
Background
This project revolves around the Sidekiq gem for asynchronous processing of email tasks. It has a queue system to hold and then process jobs. Sidekiq’s queue replaces DelayedMailer’s queue. The previous team that worked on this also created a method perform()
to gather email IDs of all participants in an assignment and send them an email reminder. Some test cases exist for this work.
Previous Setup
Initial work can be found here.
Code in the pull request was found to be reasonable and working. The method perform()
has:
Metric | Current Value | Limit |
---|---|---|
Cognitive Complexity | 15 | 5 |
Cyclomatic Complexity | 8 | 6 |
Assignment Branch Condition size | 22.93 | 15 |
Perceived complexity | 10 | 7 |
Previous pull request also has duplicated commit messages and the commits need to be squashed.
Files involved (some changed should not have been changed):
- app/controllers/assignments_controller.rb
- app/mailers/mail_worker.rb
- app/models/assignment_form.rb
- config/sidekiq.yml
- spec/models/assignment_form_spec.rb
- spec/sidekiq_mail_worker_spec.rb
- spec/spec_helper.rb
There are minor styling issues such as missing or trailing whitespaces, lines that are too long, extra empty line, unused arguments.