Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor email.py to address Code Climate issues #63

Open
thatvideoshopguy opened this issue Mar 24, 2023 · 0 comments
Open

Refactor email.py to address Code Climate issues #63

thatvideoshopguy opened this issue Mar 24, 2023 · 0 comments

Comments

@thatvideoshopguy
Copy link

Description:

The email.py file has several issues reported by Code Climate. These issues include high cyclomatic complexity, cognitive complexity, and maintainability. In order to improve the code quality, we should address the following:

  1. High cyclomatic complexity: Break down complex functions into smaller, more focused functions. This will make the code more readable and maintainable.
  2. High cognitive complexity: Simplify the logic in some of the functions by using helper functions or more straightforward control structures.
  3. Maintainability: Refactor the code to improve its maintainability and readability.

Some areas to focus on for improvement include:

  • send_email: This function has a high cyclomatic complexity and cognitive complexity. Consider breaking down the function into smaller, more focused functions.
  • smtp_send: This function has a high cyclomatic complexity. Splitting the function into smaller functions that handle specific tasks, such as establishing a connection and sending the email, can help reduce complexity.

These improvements should help address the issues reported by Code Climate and improve the overall quality of the email.py file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant