platyping
Sleeping Dragon
Copying a piece of code from vanilla seems like a good approach. A fully patched vanilla has very few bugs, which makes it a good example on how to avoid bugs.
I disagree

Some are logic bugs which don't cause errors and you will never catch any while debugging. They just display the wrong info since python is used for most screens.
Some are redundant codes which don't do anything useful, leftover from god knows what. Doing calculations for variables which are then not used at all.