8.1. Test Drupal with Drupal: Coder Module

The Coder module is a powerful tool for analyzing Drupal code. The module was created by Doug Green, but it has since had significant improvements by many users, including Stella Power and Daniel F. Kudwien. Initially it analyzed code to ensure it conformed to the Drupal coding standards and to help identify changes from one version of Drupal to another, but since it is built in an extensible manner, it can perform many different kinds of source-code analysis. It has been expanded to include some simple security checks and could be expanded to cover more security tests.

Not only can Coder be expanded in the types of tests it can run, but it can also be expanded by other modules to run additional tests. For example, the Translation template extractor module, which helps people to translate Drupal into other languages, has an additional set of tests that are available if both Coder and potx are installed. The Coder Tough Love module adds more specific tests to Coder to follow a more rigorous code-style standard.

NOTE

Learn more about these modules on their project pages:

Installing Coder is fairly typical: Download the latest version from http://drupal.org/project/coder and extract it into your sites/all/modules folder. Visit admin/build/modules to enable it, and when the page refreshes you should see the Code Review ...

Get Cracking Drupal®: A Drop in the Bucket now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.