Coder
#D7CX: I pledge that Coder will have a full Drupal 7 release on the day that Drupal 7 is released.
The Coder project includes two developer modules that assist with code review (Coder Review maintained by stella) and code manipulation (Coder Upgrade maintained by solotandem). Each of the modules supports a plug-in extensible hook system so contributed modules can define additional review standards and upgrade routines.
Coder Review
This module utilizes regular expressions to review source code files for code that 1) needs to change due to Drupal API changes and 2) does not satisfy Drupal coding standards. Beginning with the 5.x-2.x version, this module adds a new UI, core support, theme support, and a cache for faster display of unchanged files. It also supports rule #severity levels of "minor", "normal", and "critical."
Coder Review provides support for:
- Drupal Coding Standards and a first attempt on the Drupal Commenting Standards
- Converting 5.x modules to 6.x (best), 4.7.x modules to 5.x (better), 4.6.x modules to 4.7.x (basic)
- Handle text in a secure fashion (very basic, need works, but what it finds is good), Performance Review (under development)
Coder Upgrade
This module utilizes the Grammar Parser library to modify a source code file based on its grammar. The module utilizes the growing API for code manipulation (e.g., getting, setting, inserting and deleting parameters to a function call) provided by the Grammar Parser library to modify source code in a precise and programmatic fashion. The module utilizes the familiar Drupal hook system to invoke upgrade routines (e.g., for function calls and hook functions), allowing other modules to enhance or modify a routine. Contributed modules that define an API can develop upgrade routines that would enable other contributed modules relying on that API to upgrade their code.
Coder Upgrade outputs:
- the modified source code file (with an option 1) to copy and overwrite the original file, or 2) to leave the original file unchanged and write the modified file to the output directory)
- a patch file that can be more easily reviewed for the changes made and also submitted in an issue queue.
A recent example (the issue is still being debated, however) of an upgrade routine to modify Drupal core files is this one for SimpleTest test files. A recent example of modifying a custom API is shown here.
Sponsors
The Coder module was originally developed by douggreen. The Coder Review module is partially supported by CivicActions. The Coder Upgrade module is sponsored by Boombatower Development. Development of the Drupal 7.x upgrade routines has been partially sponsored by Clarity Digital Group (owners of NowPublic.com and Examiner.com).
