Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.

Refactoring to reduce the complexity of the sendMenteeApplicationEmails() method #388

Open
giovanavi opened this issue Nov 11, 2023 · 0 comments

Comments

@giovanavi
Copy link
Contributor

Is your feature request related to a problem? Please describe.
The sendMenteeApplicationEmails() method of the ProgramUtil class currently faces code smells of ExcessiveMethodLength and DuplicateCode. The method is excessively long and contains duplicate code blocks to handle sending application emails from different mentor states (APPROVED/REJECTED), which decreases readability and makes maintenance difficult.

Describe the solution you'd like
The proposed solution involves applying the "Extract Method" refactoring technique to create smaller, more focused methods. This includes:

  • Creating separate methods to build the email messages for approved and rejected mentors (buildApprovedEmailMessage and buildRejectedEmailMessage).
  • Extracting the logic for sending and saving emails into a common method (sendAndSaveEmail).

Describe alternatives you've considered
N/A

Additional context
N/A

Are you working on it?
Yes

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant