Closed (won't fix)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
19 Feb 2012 at 12:10 UTC
Updated:
21 Nov 2012 at 21:52 UTC
Searching for duplicate nodes, according to some similarity limmit parcent.
Repository:
git clone --branch master devzero@git.drupal.org:sandbox/devzero/1445614.git
Platform:
Drupal 7
Comments
Comment #1
nick_vhPlease run coder to detect any errors :
Comment #2
nick_vhComment #3
misc commented@devzero, welcome with your application.
@Nick_vh Please do not paste the output of automatic tests as comments, attach as file or link to online version if they are more than a couple of lines.
Manual review
alike_search_menu()You do not need to use t() in menus, title and description is run through t() as default.Comment #4
devzero commented@MiSc, thanks for review, I've made changes, according to your recommendations.
Comment #5
maxtorete commentedHi devzero!
Comment #6
devzero commented@Maxtorete, thanks for review, I've made changes, according to your recommendations, but as for using $_SESSION - how am I sopposed to display results in submit function, while in submit we only start batch process, and results we get in 'finished' callback? I can't see the way to do that, and current solution I think is acceptable, so now I think there is no problem with project.
Comment #7
pgogy commentedHello
hope this helps
Pat
Comment #8
soncco commented@Nick_vh try to not paste ugly code here, attach a file with it
Comment #9
misc commented@devzero, how is this status of this application, and the suggestions by @pgogy in comment #6?
Comment #10
a_thakur commented@devzero: Please remove these automated coding standard issues:
http://ventral.org/pareview/httpgitdrupalorgsandboxdevzero1445614git-7x-1x
I am manually reviewing the code, would get back to you soon.
Also, the issue summary is a bit confusing for the reviewers. Specify a command to clone the specific branch, which in this case would be: git clone --recursive --branch 7.x-1.x http://git.drupal.org/sandbox/devzero/1445614.git alike_search. Normally users won't visit the version control of a module to clone the specific branch.
Comment #11
a_thakur commentedHi,
Some manual review.
In the file alike_search.module
It would be good in case you follow the followed convention to comment while you implement any hook.
e.g.
Use
Line #13 in the alike_search.module
It is best to avoid underscores in the menu links. Instead use "-". So change to
In the alike_search.admin.inc
Some of lines in the code are exceeding margin line of 80 characters: http://drupal.org/coding-standards#linelength.
Set your editor to show the magic print margin line of 80 characters. Keeping these short assists code readability among other things.
Line #21:
Use a more clear index.
e.g.
Similarly on the line #26($v), #46('simi'), #108($v).
percent has been misspelled. Please change parcent to percent at following places.#46, #76, #108, #139, #143, #197.
The function. Line #10
which is an argument for drupal_get_form is not correct. Use in this manner.
which would help you to use $form_state['storage'] instead of $_SESSION which has been pointed out by pgogy in comment #7.
Line #113
Please choose a more specific variable name.
The above function can be rewritten as
Comment #12
a_thakur commentedHi,
In the function function alike_search_form() in the alike_search.admin.inc. Line #60 to $64.
You could do something like this:
The function node_type_get_types is described here: http://api.drupal.org/api/drupal/modules!node!node.module/function/node_type_get_types/7
Line #192 to #198 in the same file
Change it to.
Since the array is small so use it in inline format instead.
Thanks,
Ashish.
Comment #13
a_thakur commentedHi,
Some more manual review of the code.
In the alike_search.admin.inc, the function alike_search_form() must have a validation function. The following code[Line #73 to #77]
is to be validated against wrong input. In your case, you would need a validation function to specify that the input is a number between 0 to 100. Right now no such validation function exists and I used the module with "7vfcbvcx" as input to the text field which didn't throw any error. To know more about validation function refer here: http://api.drupal.org/api/drupal/developer!topics!forms_api_reference.html/7#validate
Please correct these and above mentioned reviews in the comment #7 onwards. Revert back in case you face any problem.
Comment #14
a_thakur commentedChanging the status.
Comment #15
gazoakley commentedIf this is incorrect, and you are still pursuing this application, then please feel free to re-open the thread and set the issue status to "needs work" or "needs review", depending on the current status of your code.