I get the this question on a very frequent basis. In fact, I ask myself quite frequently as well what should be checked for in order to bless SharePoint code for acceptance? The following snippet from the TechNet page sums up the reason we need to be looking at the quality of the code in the first place.
“… a poorly designed or implemented executable module that runs in a SharePoint farm can do harm even beyond the scope of the Web application for which it was intended. Poorly implemented custom solutions can introduce security or performance risks, increase the cost of support, complicate deployment, and reduce productivity. “