Be sure to move the contrib modules directory out of the Drupal tree while upgrading the core modules. Others have already mentioned coder and deadwood modules. When using deadwood, take the resulting module as a report of what needs to be done manually; there is a lot left to the user but most of it is documented in the resulting source.