Description
In the current codebase, there is a repeated pattern of logic involving retrieving, trimming, checking if empty, and conditionally setting the 'degree' value for each text field. This pattern is duplicated across multiple parts of the code.
To improve code maintainability and reduce duplication, it is suggested to extract this common logic into a private helper method. This refactoring will not only make the code cleaner but also simplify future updates and maintenance.
This issue was identified during a pull request review but was deemed out of scope for the current changes. It should be addressed in a future update to enhance the code quality.
Action Items:
- Identify all instances of the repeated logic in the codebase.
- Create a private helper method to encapsulate this logic.
- Replace the repeated logic with calls to the new helper method.
- Test to ensure no functionality is broken by the refactor.
This refactor will contribute to a more maintainable and cleaner codebase. Please prioritize this in upcoming sprints.
I created this issue for @marcnause from #2652 (comment).
Tips and commands
Interacting with Sourcery
- Generate a plan of action: Comment
@sourcery-ai plan
on this issue. - Generate a pull request for this issue: Comment
@sourcery-ai develop
to
generate a PR that addresses this issue.
Getting Help
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.