Developer Tools
For best results, use the latest development releases of this project and its dependent projects. For Coder Upgrade, the latter includes the Grammar Parser and Libraries API. As a developer tool, this project is not like a "typical" project for which you generally want the "recommended" releases on a production site. As a rule, the development releases of this project and its supporting projects are stable and meant to work together.
#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.
Live Site
From the live site, you can upload your module code and run Coder Upgrade followed by Coder Review (on the upgraded code). In return, you get clean, standards-compliant code (from the Grammar Parser output) and a jump start on your module conversion. You can even convert SQL to the new object-based DB API with the SQL conversion tool on this site.
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)
The following modules extend the reviews available in the Coder Review module:
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.
An 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.
The 7.x branch requires:
- the Grammar Parser (as a library, not "enabled" as a module)
- the Grammar Parser Library
- the Libraries API (2.x-dev)
Sponsors
The Coder module was originally developed by douggreen, partially supported by CivicActions.
The Coder Review module is sponsored by Annertech and 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).
Project Information
- Maintenance status: Seeking co-maintainer(s)
- Development status: Under active development
- Module categories: Developer, Drush, Utility
- Reported installs: 3972 sites currently report using this module. View usage statistics.
- Last modified: September 8, 2011