Closed (won't fix)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
21 Mar 2014 at 15:04 UTC
Updated:
19 Sep 2014 at 10:25 UTC
Jump to comment: Most recent
Comments
Comment #1
wolfwood commentedComment #2
PA robot commentedWe are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #3
alinouman commentedHi wolf,
Nice effort, some points in code review and testing.
1- In your javascript you have implicity declared global javascript 8 times. For eg
FnWilksFormula = {, gender = jQuery(form).find('input[name=wf_gender]:checked').val();It is very worst practice see this answer for more http://stackoverflow.com/a/6888584/974181
You can use jslint to check these kind of errors.
2- You have two big arrays with 100's of value. I am amazed that how you have type it?. Can you not calculate it on fly(some function)? Because it is making code almost unreadable.
3- On sumbit function form submits and one cannot see value. You have to make it ajax here to atleast user could see the results.
4- Have you look into ajax forms in drupal 7 https://drupal.org/node/752056 . You could all this without writing javascript,jquery and using ajax forms, it will be much more acceptable to drupal standard.
Thanks
Comment #4
wolfwood commentedThanks for the review!
1. I've updated the js by removing the globals
2. The array are copied from a spreadsheet. I thought it would be easier to use, faster and less accident prone than having to calculate it. But you're right maybe replacing it with a function/calculation is better.
3. The form isn't supposed to submit and before it didn't ... in Chrome. I've added a "return false" since "event.preventDefault();" didn't work in some (FireFox) browsers.
4. For now I don't want to implement ajax because that will add another server call. And JS can do the calculation just as well without a (slower) server call. I hope that's acceptable?
Comment #5
Janke Consulting commentedAn automated review of your project has found some issues with your code; As coding standards make sure projects are coded in a consistent style we please you to have a look at the report and try to fix them. Anyway, note that issues found are possibly false positives and fixing all issues is not a requirement for getting through the application process.
You can find the results of the automated report at http://pareview.sh/pareview/httpgitdrupalorgsandboxgodslonelyman2223039git
Comment #6
kevla commentedI've just run the same automated review as Janke did.
It looks like they're false positives. So no big deal there.
One thing that I noticed is that you're using jQuery instead of $. If your code is inside the
(function($){})(jQuery)Then you can use $.
One more suggestion I would have is that instead of using drupal_add_js (which is going to be deprecated in D8) I'd recommend moving to using a render array with the #attached key. https://drupal.org/node/930760
Comment #7
wolfwood commentedFinally had time to look at it!
I made some more changes to the js based on the review and jslint. I only get one last error for numbers like: 1.291E-08 (anybody who can tell me the name of that notation?). Not all browsers seem to like it if I put a space in there.
kcmanc87's suggestion to add the js file to the render array has also been implemented. :)
Comment #8
wolfwood commentedComment #9
ram4nd commentedComment #10
izus commentedsettings the status as per #9
Comment #11
wolfwood commentedWhat is wrong with the po file and the screenshot?
I put up a new screenshot which looks a bit better just in case. The po files seems fine, it works and all texts are needed.
Removed the typo in front of <?php, reduced the space indents from 4 to 2 and added a bit more comments to the js. :)
Comment #12
ram4nd commentedWhy not use ajax functionality built in Drupal. That way it works when you don't have JavaScript enabled as well.
http://browse-tutorials.com/tutorial/create-ajax-forms-drupal-7
Comment #13
wolfwood commentedHow would you make an ajax call with javascript disabled?
Comment #14
joachim commentedPo files are obsolete.
You don't need to render the form. See how user_block_view() does it.
Also, if this function is only has three lines (and one is about to be removed), you're better off folding it into wilks_calculator_block_view(). Especially as then you don't need the return, so you've only one line.
Missing form builder params.
Also, no need to document the return for form handlers, as their signature is standard.
The ) should be on a new line.
Don't include the ':'. Form API does that sort of thing.
Why are you doing all of the calculation in JS?
Comment #15
ram4nd commentedNo, it will work regardless. If javascript is enabled it will use ajax for it, if not then page refresh. Also the code has to be in php as suggested.
Comment #16
joachim commented> If javascript is enabled it will use ajax for it, if not then page refresh.
I don't see how that can be possible, as all the code to perform the calculation is in JS. AFAICT there is no PHP code for doing that -- maybe I missed it?
Comment #17
wolfwood commentedI think ram4nd means that's possible after putting the code in PHP, but I put the calculation in JS basically because it's a bit faster (on a slow (shared hosting)server a php request just feels really slow.
The rest of your recommendations are implemented, joachim. :)
Comment #18
gisleAutomated Review
OK.
(PAReview.sh output http://pareview.sh/pareview/httpgitdrupalorgsandboxgodslonelyman2223039git are false positives.)
Manual Review
.pofiles are obsolete and must be removed from the repo. Translations are done on http://localize.drupal.org.screenshot.jpgservers no purpose, and must be removed from the repo. We don't host repos on Drupal.org that contains random bits and pieces that is not used by the project and it is not explained in the README.txt why they are included.The starred items (*) are fairly big issues and warrant going back to Needs Work. The rest of the comments in the code walkthrough are recommendations.
Comment #19
gisleAdding tag.
Comment #20
PA robot commentedClosing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).
I'm a robot and this is an automated message from Project Applications Scraper.