-
Notifications
You must be signed in to change notification settings - Fork 429
Tech debt: remove duplicated code in data class #6293
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
Comments
Hi @ericbn! I'm assigning this issue to you. |
Oi @leandrodamascena. Cool, thanks! I wish there was a linter that would check this automatically, but I’m not aware of any. I just manually checked a few base classes. EDIT: Actually I’ll give this a try locally: https://pylint.pycqa.org/en/latest/user_guide/messages/refactor/duplicate-code.html |
Ei @ericbn! We have some report about code duplication here: https://sonarcloud.io/component_measures?metric=duplicated_lines&selected=aws-powertools_powertools-lambda-python%3Aaws_lambda_powertools&id=aws-powertools_powertools-lambda-python The reason that we don't add a linter to check code duplication is because sometimes it's necessary for some reason. I think make sense we try to reduce the number of duplicated code, if possible. |
Cool, I see now. I've used pylint locally to double check overriding code that is duplicate and updated the PR. I see there's potential to refactor ClaimsOverrideDetails, ClaimsAndScopeOverrideDetails and TokenClaimsAndScopeOverrideDetails to have one or two common bases. But can we merge #6289 first? |
|
Why is this needed?
The data_classes module contains instances of duplicated code, which can lead to increased maintenance effort, potential bugs, and reduced code clarity. This issue proposes refactoring the module to eliminate redundant code by consolidating shared logic and improving overall code quality.
Which area does this relate to?
Event Source Data Classes
Suggestion
No response
Acknowledgment
The text was updated successfully, but these errors were encountered: