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 devilution.DefaultClass::CheckInvPaste(int, int, int) #1996

Open
AJenbo opened this issue May 17, 2021 · 1 comment
Open

Refactor devilution.DefaultClass::CheckInvPaste(int, int, int) #1996

AJenbo opened this issue May 17, 2021 · 1 comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@AJenbo
Copy link
Member

AJenbo commented May 17, 2021

I've selected devilution.DefaultClass::CheckInvPaste(int, int, int) for refactoring, which is a unit of 362 lines of code and 135 branch points. Addressing this will make our codebase more maintainable and improve Better Code Hub's Write Simple Units of Code guideline rating! 👍

Here's the gist of this guideline:

  • Definition 📖
    Limit the number of branch points (if, for, while, etc.) per unit to 4.
  • Why
    Keeping the number of branch points low makes units easier to modify and test.
  • How 🔧
    Split complex units with a high number of branch points into smaller and simpler ones. This one in particular has a big switch that could probably be split out in to sub-functions.

You can find more info about this guideline in Building Maintainable Software. 📖


Good luck and happy coding! :shipit: ✨ 💯

@AJenbo AJenbo added good first issue Good for newcomers help wanted Extra attention is needed labels May 17, 2021
@matheusgomes28
Copy link
Contributor

Created #6984, need some initial feedback + figure out how to run the failing test locally so I can debug it 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants