Please:
- Download and install the Coder module.
- Visit
admin/modulesto enable both "Coder" and "Coder Review" modules - Visit
admin/config/development/coder/review. - Under apply the checked coding reviews select minor (most).
- Under WHAT TO REVIEW and SELECT SPECIFIC MODULES check the box next to your module.
- Click the Run reviews button at the bottom.
- Correct the problems noted.
I have done this for you once. The results are attached.
Additional problems not covered by Coder module:
- README.txt
-
- Lines in text files should be word-wrapped at 80 columns.
- The word INSTALLATION is incorrectly spelled as INSTALATION.
- mailwire.info
-
- The
files[]section should only include files that contain optional class definitions not loaded on every page request. - The word modules is incorrectly spelled as modlues.
- The
- mailwire.install
-
- The
include_onceline should not assume that the mailwire module directory is on the include path. - Both the file and its included functions lack documentation headers. See Doxygen and comment formatting conventions.
- Conditions within control structures should not wrap to multiple lines. See Line length and wrapping.
- In the
mailwire_requirements()function, you state:
MailwireMailSystem must be the default-system and the only value in the mail_system system variable.
In other words, your module is incompatible with all other Drupal-7 mail-sending modules. Perhaps, in time, your approach may gain widespread acceptance and other ways of doing things will be deprecated in favor of your approach, but you might want to consider starting off with compatibility in mind, rather than incompatibility.
- Consider replacing:
ob_start(); var_dump($mail_system); $output = ob_get_clean();with the simpler and cleaner:
$output = var_export($mail_system, 1); - The word module is incorrectly spelled as modul.
- Both the per-file and per-function document headers are missing. See Doxygen and comment formatting conventions.
- The
- mailwire.interface.inc
-
- The
@filedocument header is missing.
- The
- mailwire.log.inc
-
- Because you pass a variable rather than a translatable string to drupal_set_message, your module cannot be translated into other languages. See Module documentation guidelines and String translation is mandatory; use it and love it.
- mailwire.mail.inc
-
- In the
format()andmail()functions, the database lookups should be cached. - Consider using the Drupal-7 class registry rather than reinventing the wheel.
- Using
debug_backtrace()to find the calling module is a horrible, horrible hack.
- In the
- mailwire.module
-
- Your inline documentation states:
If a module wishes to send emails in a special way it can do so by setting the mail_sytem variable (http://drupal.org/node/900794).
This contradicts the code and comments in your
mailwire_requirements()function. - There are too many spelling errors to list them all.
- Consider renaming
mailwire_set_clear_cash()tomailwire_set_clear_cache. - Consider re-wording:
* Currently every MailSender must not be registered more than once.
as:
* Registering a MailSender class more than once will currently result in(some consequence).
- Your inline documentation states:
| Comment | File | Size | Author |
|---|---|---|---|
| mailwire-coder-review.png | 238.15 KB | pillarsdotnet |
Comments
Comment #1
pillarsdotnet commentedComment #2
pluess commentedComment #3
sgabe commentedIt is very unfortunate to mark this issue as won't fix since the problems listed here are still existing in the module. I would encourage you to fix these problems ASAP. By the way, pillarsdotnet thanks for the review!