Morse code converter is simple module in Drupal 6 that converts normal english alphabets (US/UK) into morse-code and vice versa.
Morse Code Converter

Repository link for the same is as follows :
git clone --branch master http://git.drupal.org/sandbox/prathK/1282520.git morse
cd morse

Currently developed and tested in only D6. According to response will be available for further more encryptions as well if needed. I will push D7 port of the same soon.

Reviews of other projects
http://drupal.org/node/1292298#comment-6189662
http://drupal.org/node/1672796#comment-6209532
http://drupal.org/node/1666230#comment-6209664

Comments

sreynen’s picture

Status: Needs review » Needs work

Hi prathK,

I reviewed your project and created a couple issues in the project issue queue. Please change the status back to "needs review" when those are fixed.

prathK’s picture

Status: Needs work » Needs review

Hi,

I have fixed the issues ( http://drupal.org/node/1304508 and http://drupal.org/node/1304506) present for my previous version 1.x now I have created another branch for the same as it was issue related to changing the whole flow of the module without JS.

Now new branch 2.x is available at following location:

git clone --branch 6.x-2.x http://git.drupal.org/sandbox/prathK/1282520.git morse
cd morse

patrickd’s picture

Status: Needs review » Needs work

welcome!

naming the branch 6.x-2.x makes no sense for me, is there a special reason for this?

There are still files other than README.txt in the master branch, make sure to remove them. See also step 5 in http://drupal.org/node/1127732
Review of the 6.x-2.x branch:

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Go and review some other project applications, so we can get back to yours sooner.

prathK’s picture

@patrickd

Yes making 6.x-2.x branch was required as in earlier branch I was using simple ajax call for the same.
In the 2.x version no js call will be made instead sessions will be used to store the temporary converted code. so core functionality was modified I felt its necessary to change the branch as no more js will be used for the same.

Thanks,
prathK
extrimity.in

prathK’s picture

Assigned: prathK » Unassigned

@patrickd

I have committed all the necessary changes and reviewed the code.
I have also added README.txt file in the same folder of module.

http://ventral.org/pareview/httpgitdrupalorgsandboxprathk1282520git

It is ready to project review.

Regards,
PrathK
extrimity.in

chertzog’s picture

Status: Needs work » Needs review

Couple things:
1. Both of the functions below contain the same entire alphabet to morse array.

function morse_convert_to_arebic($num) {}
function morse_convert_to_morse($num) {}

Why not move the array into its own helper function and then just call the function when you need it.

function _morse_alphabet() {
  $alphabet = array(
    "A" => ".-",
    "B" => "-...",
    "C" => "-.-.",
    "D" => "-..",
    "E" => ".",
    .....

  return $alphabet;
}

function morse_convert_to_arebic($num) {
  $MORSE_CD = _morse_alphabet();
...
}

This will avoid duplication.

2. Your hook_help and info file state that it only converts numbers.
morse_help:

The morse module converts the normal numbers into morse numbers

morse.info:

converts the simple number into morse code.

Your module converts more than just numbers. It should say something like your @file block in your module file:

Converts the alphanumeric values into morse code.

3. Your submit buttons should be in an "actions" array element.

  $form['actions'] = array('#type' => 'actions');
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t("Convert"),
    '#weight' => 30,
  );

It's always good to put (submit) buttons in an "actions" form element.

luxpaparazzi’s picture

Automtated review:

There are still files other than README.txt in the master branch, make sure to remove them. See also step 5 in http://drupal.org/node/1127732
Review of the 6.x-2.x branch:

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Get a review bonus and we will come back to your application sooner.

Code too short
This project is too short to approve you as git vetted user. We are currently discussing how much code we need, but everything with less than 120 lines of code or less than 5 functions cannot be seriously reviewed. However, we can promote this single project manually to a full project.

Even so your project has more than 5 functions and more than 120 lines, I find it diffcult for doing a serious review... don't know what other think...

Manual review:

function morse_perm() {
  return array('access morse converter');
}

The permission is never used!
See: 'access callback' => TRUE

luxpaparazzi’s picture

Status: Needs review » Needs work

forgot status change

luxpaparazzi’s picture

The response time for a review is now approaching 4 weeks.
Get a review bonus and we will come back to your application sooner.
See: http://drupal.org/node/1410826

You could for example start by evaluating my own project:
http://drupal.org/node/1302786

prathK’s picture

Assigned: Unassigned » prathK
Status: Needs work » Needs review

Hi,

I have reviewed my module and all the changes are updated in the repository 6.x-2.x.
All the comments are taken into account to update the latest version.

http://ventral.org/pareview/httpgitdrupalorgsandboxprathk1282520git

It is ready to project review.

Regards,
PrathK
extrimity.in

sreynen’s picture

Assigned: Unassigned » prathK
Status: Needs review » Reviewed & tested by the community

This looks good to me. I don't see any new issues and all previous issues have been addressed with the exception of the 'actions' #type, which I believe was only added in Drupal 7, so can't be used in this Drupal 6 module.

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

prathK’s picture

Issue summary: View changes

Issue summary updated with new field.

prathK’s picture

Issue tags: +PAreview: review bonus

Thanks syreynen and klausi,

Reviews of other projects
http://drupal.org/node/1292298#comment-6189662

Regards,
prathK
extrimity.in

klausi’s picture

Issue tags: -PAreview: review bonus

Removing review bonus tag, you need to do 3 manual reviews of other projects, not just one. See #1410826: [META] Review bonus. And please add your review links to your issue summary.

klausi’s picture

Issue summary: View changes

updated comment.

prathK’s picture

Issue summary: View changes

second review added.

prathK’s picture

Issue tags: +PAreview: review bonus

Hi klausi,

Thanks for the correction. :)
I have done 3 manual reviews of modules and added to my issue summary page.

Regards,
prathK
extrimity.in

klausi’s picture

Assigned: prathK » Unassigned
Status: Reviewed & tested by the community » Needs work
Issue tags: -PAreview: review bonus

There is still a master branch, make sure to set the correct default branch: http://drupal.org/node/1659588 . Then remove the master branch, see also step 6 and 7 in http://drupal.org/node/1127732

manual review:

  1. project page is too short. How does the module work and where is the code conversion displayed? See also http://drupal.org/node/997024
  2. morse(): this is not a hook, but a form building function and should be documented as such. See http://drupal.org/node/1354#forms
  3. morse(): why do you need to read/write the user session? Submitted form values are available in $form_state['values'] in your form constructor, see http://drupal.org/node/751826
  4. morse_convert_to_morse(): doc block for parameters/return values is wrong, see http://drupal.org/node/1354#functions . Also elsewhere, it is called "@param" not "@params".
  5. morse_submit(): if wonder if you need that function if you use $form_state in the form contructor.
  6. morse_convert_to_arebic(): I think you should reverse the array returned by _morse_alphabets() with array_flip(), then you don't need to search the array and can just access with $morse_codes[$v]. Which is also more efficient.
  7. "$output .= "";": this has no effect, why do you need that?

I bump this back to needs work, because I think writing to the session is really wrong here. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

prathK’s picture

Hi,

1. Project page has been updated.
2. The function documentation for morse() is updated as well.
3. Session was used as I couldn't find other way so that I could get the processed value from submitted section back to actual form. Also its bit confusing about form constructor in my case we are calling drupal_get_form hook directly to call morse() function so there is actually no $form or $form_states which contains value of any element in the form.
4. morse_convert_to_morse(): doc block updated.
5. _morse_alphabets() is added as helper function to avoid duplicate array.
6. For every morse code there should be unique number of spaces to be added so $output .= "" was required.

New code is updated with deletion of master branch.

Regards,
PrathK
http://extrimity.in

sreynen’s picture

prathK, morse() not having $form and $form_state parameters is a problem you can fix simply by adding those parameters. You're implementing hook_form(), but not following the documented parameters for hook_form().

prathK’s picture

Status: Needs work » Needs review

Hi,

I have added the documentation properly also updated the code for the same.
It is better to user the $form contents as explained by sreynen. I have updated the code such a way that user will be able to see the output in the notification area itself. I hope this solves the issue with session as well.

Thanks sreynen for your valuable feedback. I am hoping at least now we can push this module to final version.

Regards,
PrathK
http://extrimity.in

adnasa’s picture

just want to take the time here and say that I really like module idea ;-)

bhosmer’s picture

Status: Needs review » Reviewed & tested by the community

I like it!

If you do three more reviews, you should get this promoted pretty quickly.

klausi’s picture

Status: Reviewed & tested by the community » Needs work

manual review:

  1. "'#value' => "Convert",": all user facing text must run through t() for translation.
  2. morse_form(): you do not implement a node type, so it does not make sense to implement hook_form(). Please rename that function so that there is no confusion. And $node should be $form, $form_states should be $form_state.
  3. morse_arebic_form(): wrong doc block, this is not a hook but a form building function. See http://drupal.org/node/1354#forms
  4. Both your form building functions will never get a node passed, so that is really confusing.
  5. morse_form(): displaying the message should be done if $form_state['values']['alphabet'] is set. Similar in morse_arebic_form().
prathK’s picture

Status: Needs work » Needs review

Hi,

Thanks klausi for providing your feedback. Fixes for all above mentioned queries has been resolved.
1. all user facing texts are going through t() function.
2. I was using the hook_form() as I was not using additional function for form_submit() but now I need to use the same because I have removed hook_form() so submit() function becomes necessary to take values.

Also done review with ventral after checking all.
http://ventral.org/pareview/httpgitdrupalorgsandboxprathk1282520git

Thanks & Regards,
prathK
http://extrimity.in

scott weston’s picture

Status: Needs review » Reviewed & tested by the community

I have reviewed and tested the module. It appears that all previous indicated issues have been resolved. I do not see any code-specific issues which need to be addressed.

The module works as described.

klausi’s picture

Status: Reviewed & tested by the community » Fixed

manual review:

  • morse_submit(): why do you need check_plain() here? $num is not printed to the user? Same in morse_arebic_submit().

Not an application blocker, so ...

Thanks for your contribution, prathK!

I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

prathK’s picture

Thank you so much klausi for reviewing final code and updating my account !!!
Thanks to all reviewer(s) for taking time and reviewing the code !!!
I will resolve this minor issue and update the code.
I will try to contribute through reviewing modules as well on community.

Regards,
PrathK
extrimity.in

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Third module review.