Drupal Standard Code

Component ID

1257116

Component name

Drupal Standard Code

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

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 :)

Reliability
It has been successfully run on 3K+ random LOC while testing. It caters to only the basic standards and ideally there is nothing to break your code. Yet its complete testing is massive and (personally)it is suggested to observe caution to developers willing to use this module.

Current Status
Currently it is UNDER DEVELOPMENT.
Needs to close these critical bugs
http://drupal.org/node/1262956
http://drupal.org/node/1262952

Project Abandoned