The Drupal coding standards docs are a great reference for developers, but there’s also an automated way of checking your code: the Coder module. Here’s how it works:
1. Install
Copy to sites/all/modules
and enable the usual way. Now you have a new link in Navigation:
2. Choose reviews
Click that link, then select exactly what you want the Coder module to do on this page:
3. Targets
Select what you’d like to review, there are many different options:
4. Submit
Submit, then view the results: