Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
#NOD8CX: I have no plans to have a full D8 release within even a year of when Drupal 8 is released unless someone else volunteers to co-maintain that branch.
This module eases the process of making code Drupal Standard compliant.
It provides a simple configuration page to select the modifications and generates a modified file having most of the coding standard issues fixed.
Why not Grammer Parser module? Grammer parser is a great module that allows much more than just sanitizing the code. But firstly it is a complete library, not available in D6(until it is patched) and secondly it does not provide any control over the modifications.
How it works?
It takes whole file as a string and replaces occurrence of sub-strings using simple string replace and regex functions.
Why as a string and not array?
Though array gives more control over the modifications and some more replacements could have been added, strings approach avoids large scale looping and basic replacements can be done as effectively. More complex replacements/fixes(like changing variable in a query to placeholders) need utmost caution and thus are not in scope of this module so that there is something for the developers to do :)