Media Mover SNS

http://drupal.org/sandbox/math3usmartins/1900588

GIT Repository: git.drupal.org:sandbox/math3usmartins/1900588.git

Summary

Media Mover SNS (MM SNS) extends the Media Mover (MM) module by integrating it with Amazon SNS and adding three new actions to MM configurations.

After installed and configured properly, whenever a file is uploaded, the site will publish a message on Amazon SNS, in the topic that defined in the MM configuration.

Currently it supports only Drupal 6.

Comments

abhijeetkalsi’s picture

Hi,

first of all there are quite a few issues to sort out such as indentation, whitespace.

You can find them all here:
http://ventral.org/pareview/httpgitdrupalorgsandboxmath3usmartins1900588git

Here you can check source code whether it meets drupal coding standards or not, and advise you what to change in your code. You can repeat review after your commits, and can fix those errors.

monymirza’s picture

Status: Needs review » Needs work
math3usmartins’s picture

Status: Needs work » Needs review

Code review result

FILE: /var/www/drupal-7-pareview/pareview_temp/mm_sns.module
--------------------------------------------------------------------------------
FOUND 9 ERROR(S) AFFECTING 9 LINE(S)
--------------------------------------------------------------------------------
110 | ERROR | Concatenating translatable strings is not allowed, use
| | placeholders instead and only one string literal
265 | ERROR | Case breaking statements must be followed by a single blank line
269 | ERROR | Case breaking statements must be followed by a single blank line
285 | ERROR | Array indentation error, expected 4 spaces but found 6
297 | ERROR | Array indentation error, expected 6 spaces but found 8
308 | ERROR | Case breaking statements must be followed by a single blank line
312 | ERROR | Case breaking statements must be followed by a single blank line
364 | ERROR | Function comment short description must be on a single line
398 | ERROR | Function comment short description must be on a single line
--------------------------------------------------------------------------------

My comments

110 | ERROR | Concatenating translatable strings is not allowed, use
| | placeholders instead and only one string literal

The problem is in the '#description' value.
I had to break the line to meet the 80 chars limit.
I don't see a better way to do that without causing other errors.

function mm_sns_admin_form(&$form_state = array()) {
  // ...
  // some code here
  // ...

  $form['mm_sns']['mm_sns_aws_sdk_dir'] = array(
    '#type' => 'textfield',
    '#default_value' => variable_get('mm_sns_aws_sdk_dir', ''),
    '#title' => t('AWS PHP SDK directory'),
    '#description' => t('Enter the AWS PHP SDK directory name within the'
      . ' default library directory. eg. aws_php_sdk_1'),
  );
265 | ERROR | Case breaking statements must be followed by a single blank line
case 'storage':
      return mm_sns_media_mover_storage($op, $action_id, $configuration,
        $file);

I had to break the line to meet the 80 chars limit. That's why the line right after the case-break statement (ie. "return") isn't blank.

It also applies to similar messages.

285 | ERROR | Array indentation error, expected 4 spaces but found 6

From Drupal Coding Standards (http://drupal.org/coding-standards#array):

Note that if the line declaring an array spans longer than 80 characters (often the case with form and menu declarations), each element should be broken into its own line, and indented one level:

364 | ERROR | Function comment short description must be on a single line

/**
 * Configuration form when using the action that just publishes a message on
 * Amazon SNS during the upload "storage" or "complete" step.
 */

Is it a short description? What's a short description definition?

klausi’s picture

We are currently quite busy with all the project applications and I can only review projects with a review bonus. Please help me reviewing and I'll take a look at your project right away :-)

adnasa’s picture

You are handling a couple of variable_set / variable_get

It would be optimal if you implement hook_uninstall() to remove your variables upon an uninstall from the database :-)

Best of luck!

math3usmartins’s picture

Assigned: Unassigned » math3usmartins

Good point, thanks!

math3usmartins’s picture

Status: Needs review » Needs work

I'm going to implement the hook_uninstall()

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application.

I'm a robot and this is an automated message from Project Applications Scraper.