Closed (won't fix)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
6 Dec 2013 at 14:31 UTC
Updated:
12 Apr 2015 at 04:25 UTC
Jump to comment: Most recent
Comments
Comment #1
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxrublon2146525git
We 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 #2
s_leu commentedCoder review result:
Coder found 1 projects, 29 files, 23 normal warnings, 0 warnings were flagged to be ignoredAll of them are indent problems. Guess those should be fixed to conform the coding style standards.
Comment #3
RublonMichal commentedW have adjusted the code according to "Project aplication checklist" at http://pareview.sh/pachecklist.
We have installed Coder on our Drupal installation and then we have ran the review. The result is:
Coder found 1 projects, 29 files, 0 warnings were flagged to be ignored
Most of minor warnings were related to our library, which is included in the module as a third-party package.
Comment #4
alexverb commentedHi rublon,
I can see you are new to the Drupal scene and have a few topics I want you to look at. Seeing your code I have no doubt you can tackle these problems.
Coding standards:
You still have a lot of errors regarding the Drupal coding standards as commented by the bot in the first comment:
http://pareview.sh/pareview/httpgitdrupalorgsandboxrublon2146525git.
They are mostly indenting and whitespace issues. On D.0. we increment indenting with 2 spaces instead of tabs like you do. If you would like to learn more about the coding standards you can do so here:
https://drupal.org/coding-standards
Libraries API
I do realise that you're using an external library that is generating all these errors. If you would like to clean that up I suggest you try using the Libraries API. This way you can keep te library outside of your project and others can reuse it. But that would mean that you should put the Drupal hooks back into the module. If you want to know how to implement external libraries you can read up on it here:
https://drupal.org/documentation/modules/libraries
Fix git clone command:
You should also correct your git clone line in this topic's description. I'm unable to clone your project with it. It's just a ":" sign that needed to be replaced with a "/". It's best to wrap the text in a code block. Something in the lines of this should work:
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/rublon/2146525.git rublonThe t() function:
Looking at your code I see you are using OOP. That's very good but above my own paygrade. From the little bits that I can check like the form alters and stuff I can see you aren't yet familiar with the best practices of security measures and translations in Drupal. You should wrap all your form titles and descriptions text in the t() function for translation. If you use any user defined text you should use placeholders that automatically takes care of sanitizing the text. Read up on it over here:
https://api.drupal.org/api/drupal/includes!bootstrap.inc/function/t/7
The Form API:
Good use of function commenting.
One thing I've also noticed is that you have excellent function commenting practices. Like declaring the variables, the return value, function references. That's something not everyone does in Drupal 7. My guess is that you have a programming background in IT schooling. You just have some other ways of doing stuff, therefore not less than Drupals way. But if you would like to get your project promoted to a full project there's no way around Drupal coding standards.
I think that's about enough material for you to start with.
Welcome to the Drupal community. Hope you will stick around.
We need OOP'rs like you :)
Comment #5
RublonMichal commentedThanks for the comments above. We have dealt with all the issues that you have pointed to us.
Comment #6
nitesh sethia commentedWhile going through the module i could get figure out couple of issues :
1. In the css file you have used
but there is no such property such as
clear:left.Rather it is
clear:bothor if you want to align it to the left it should be
float:left.2. Also there is an error in your module with .php files..
Comment #7
RublonMichal commentedHello.
We have looked at the indicated issues and frankly we don't understand where exactly is the problem.
The
clear: leftcode is a perfectly valid CSS property, as stated e.g. here: https://developer.mozilla.org/en-US/docs/Web/CSS/clear (a website suggested by the W3C as a good CSS reference). It is even used in the Drupal core modules themselves (e.g. the System core module).As for the
RublonButton::__toStringbeing invalid due to double underscore being reserved to magic methods - that's no coincidence we're using it there, as this IS a magic method for the RublonButton class.__toString()has been a valid magic PHP method for a long time, and since PHP 5.2.0 (and that's year 2006) it hasn't been restricted to use only in conjunction with echo and print.Comment #8
heddnAll user accounts are for individuals. Accounts created for more than one user or those using anonymous mail services will be blocked when discovered (see Get a Drupal.org account).
Please note that organization accounts cannot be approved for git commit access. See https://drupal.org/node/1966218 and https://drupal.org/node/1863498 for details on what is/isn't allowed. Please update your user profile so that we don't have to assume that this is a group account.
Comment #9
RublonDev commentedLucas, thank you for pointing this out. I have now added my personal details to the profile. Hope that everything's good now :-)
Comment #10
RublonMichal commentedLucas, that was another account I just used. Now everything should be correct. Thanks again.
Comment #11
RublonMichal commentedComment #12
heddnCan this module use the libraries API (www.dgo.to/libraries) rather than bundling the third party app with the module? It makes it nearly impossible with the sheer volume of the code to do a proper code review. Here's some things to chew on until someone has time to do a more full review.
The following git branches do not match the release branch pattern, you should remove/rename them. See http://drupal.org/node/1015226
remotes/origin/7.x-1.0
remotes/origin/7.x-1.x-dev
.info file:
You should add a package. Its optional but helpful. (https://drupal.org/node/542202#package)
PHP version: https://drupal.org/node/542202#php
Configuration: https://drupal.org/node/542202#configure
.install file:
INSTALL.txt says the module requires cURL so you should add a hook_requirements.
Example: http://drupalcode.org/project/oauth.git/commitdiff/8e2d9d8
No uninstall function to remove any variable_sets.
.module file:
require_once dirname(__FILE__) . '/libs/RublonDrupal.php';Use https://api.drupal.org/api/drupal/includes%21module.inc/function/module_.... Or better yet, use www.dgo.to/composer_manager and/or some other autoloader.
* Implements hook_form_FORM_ID_alter() for user_profile_form().This line should simply be
Implements hook_form_FORM_ID_alter().. Everything else should go as new lines of comment.* @see drupal_prepare_form()This isn't needed.
* @see hook_user_view_alter()This isn't needed in line 30. In fact the entire hook_user_view_alter is unnecessary.
* @see hook_user_login()Unnecessary comment because of the Implements foo comment.
No need to pass FALSE to user_load as that is the default.
if (!empty($user) AND is_object($user) AND !empty($user->uid)) {Only need to check for $user as the interface for user_load will return FALSE if something unexpected happens.
Use module_load_include.
Comment does not match function or method signature (at line 151 of RublonDrupal.php)
Constant 'TEXT_MSG_ERROR' not found in class (at line 721 in RublonDrupal.php)
Unused local variable $destination (at line 600 in RublonDrupal.php)
Variable 'response' might have not been defined (at line 502 in RublonConsumerRegistrationTemplate.ph)
Variable 'response' might have not been defined (at line 496 in RublonConsumerRegistrationTemplate.php)
Unused local variable $result (at line 20 in RublonText.php)
Unused parameter $options (at line 295 in RublonIssueNotifier.php)
Comment #13
RublonMichal commentedHello @heddn, thank you for your comments! We have looked into your review and introduced some major changes to our module.
As suggested, we have separated our library from the module and used it with the Libraries API. We've added the appropriate info about the library's installation in the INSTALL.txt file, we've also addressed all issues and suggestions pointed by you. Additionally, the module will check for the presence of cURL and has a package info added, we also refrained from using require_once and switched to module_load_include entirely.
We'd be grateful for anyone to take a look at our module again, we hope it's up to Drupal standards now.
Comment #14
ethantHi @RublonMichal. I've reviewed your module, and have a few suggestions:
1) In terms of functionality, I'm afraid I'm dead in the water on the first step found in your help text:
Q: How do I use Rublon?
A: In order to use Rublon in your Drupal installation please go to
"Your Profile -> Edit" section and click "Protect your account".
On said page, logged in as admin, I see this:
Rublon will be available to you once your administrator protects his account.
Since your account is protected by a password only, it can be accessed from any device in the world. Rublon protects your account from sign ins from unknown devices, even if your password gets stolen. Learn more at www.rublon.com.
There are no further instructions or options available to me.
2) In terms of code review, your module passes all my phpcs drupal sniffs, but it sure would be nice to see more notes in your code, particularly in the .module file. You have taken a hardcore oop approach, and I find it pretty confusing to track things down without some pretty extensive notes / explanations relating to each object.
3) It would be nice if you could add a configuration link to your info file, i.e.,
configure = user/{UID}/edit- not quite sure how you'll plugin in the user id, but something like that would be helpful, if possible.Thanks for your hard work.
Comment #15
klausson commentedPAReview.sh actually still comes back with a long list of errors. Most have to do with parameter comments and seem not very important. Do take a look at some of the lines that comment on whitespaces being located where they shouldn't be - this kind of stuff tends to throw off diffs since it's hard to see with the naked eye.
@EthanT: Ran into the same problem configuring a user account. But I disagree on the doc comment for the OOP patterns - here's why: The method calls are actually meticulously documented in the class implementations. Adding more comments in rublon.module would be redundant, IMHO.
Comment #16
klausson commentedAutomated Review
Review of the 7.x-1.x branch (commit e3f0d95):
PAreview still comes back with a lengthy list of errors. Most look very minor, but some could throw off tools like diff and grep when looking for specific patterns (example: space after ? operator). http://pareview.sh/pareview/httpgitdrupalorgsandboxrublon2146525git
Manual Review
Comment #17
RublonMichal commentedHi Klaus,
Thank you for your review.
We have fixed all of the PAReview issues and pushed a new version.
Our answers regarding the "Coding style & Drupal API usage" section:
1. The design of that button is indifferent to Drupal or any other system, it's also deeply dependent on our marketing and is being used in quite a few CMS/e-commerce systems. Changing that button would mean changing all Rublon graphic design in every possible solution. We are preparing a redesign of our media assets in the nearest future - we hope the redesigned button will be more accessible and straightforward.
2. The reaction time of our QR code scanner described by you is a worrying issue. We have tested the scanner on the most popular platforms and we haven't experienced any problems as the one you're describing.
3. Email messages in incorrect language should no longer be sent. We have fixed this, thank you for noticing it.
Comment #18
klausson commentedHi Michal,
I do realize that the three issues I raised have little to do with the Drupal implementation. I think the first one is probably the most important one and has to do with the fact that the message talking about securing the master account first is getting people to think in the wrong direction, especially since it does show on the master account's screen as well as everybody else's. I think my real question is, is this really a rule you need to have enforced? If not, you could avoid quite a bit of confusion by simply eliminating all that language.
The second issue is definitely outside the scope of the Drupal implementation. I just wanted you to be aware of it. I did confirm that the third one is no longer happening in the confirmation mails.
So in summary, I think you'll need to make a decision on number 1 and bring the status back to review. I'm happy to support it being sent to RTBC status after that.
Klaus
Comment #19
RublonMichal commentedHello Klaus,
Thank you for your comments.
We have addressed the issue with the misleading message about securing the master account, for both administrator accounts as well as ordinary user accounts. We hope it will clear any confusion you might have experienced.
Since those messages were independent of our Drupal module code (they're loaded from an external server), these changes are now live and you can check them without updating the module since no new code was pushed to git.
Comment #20
klausson commentedTested and confirmed. Switched the status to RTBC.
Neat stuff!
Comment #21
stborchertHm, a quick question about your user account ... in #2151429-9: [D7] Rublon you said, you've entered your personal data but none of the accounts you've answered with includes any personal information and still looks like a group account of your company. Apart from this you are always speaking of "we" ... are you developing this module as a single person or as a group?
Comment #22
RublonMichal commentedHello and thanks for your comment, Stefan.
I've included my personal data on the profile page. The reason the comments looked as if they were written by multiple people is that while the module had been developed by a single person, the comments were written by an additional person who helped me with support tasks. I didn't realize that I can add additional Drupal.org users to my project as maintainers and grant them git access or allow them to participate in the project discussion and take care of issues. Should additional developers be taking part in the development of the module, they will have their own personal accounts and will be added to the project as co-maintainers.
Comment #23
RublonMichal commentedHey
Is there any chance that Rublon for Drupal will finally get out of the sandbox? :-/
Comment #24
klausson commentedI just ran one more PAReview scan to make sure nothing else has popped up in the meantime and it came back clean. No other objections were raised in the last few weeks, so I will switch the status to "Fixed".
Comment #25
heddnre #24: The project still has to wait for a git admin to review the project and provide the appropriate access to @RublonMichal. Moving this back to RTBC.
re #23: I hoping to review this soon.
Comment #26
heddnManual Review
module_load_includein a global context. See the phpdoc for why._rublon_callback()=> Could this move to rublon.drupal.inc?ANDinstead of&&The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
Overall, the code is well written and documented. It is a joy to read. In general, usage of more of Drupal's FAPI and theme layer are areas of improvement. I'm fairly sure there are some things I've missed in my review above, however I simply ran out of time and wanted to get some feedback back, rather than sit on it for longer until I can complete the review.
Comment #27
RublonMichal commentedHi Lucas
Thank you for taking your time to review our module. We will look into this and post an updated version soon.
Comment #28
kscheirerOverall awesome module and service!
Blocking Issues:
Non-blocking issues:
module_load_include()right at the top - it's better to tuck that inside the function that needs it, similar to how you've already got it in rublon_uninstall().If you can resolve that one blocking issue, I'd be happy to promote this to RTBC.
Comment #29
rdeboerI second the findings of the reviewers in #26 and #28.
With those fixed it is RTBC from me as well.
The use of an /assets folder that just has /css/rublon.css in it is perhaps a little esoteric by Drupal standards, but not wrong.
Documentation on project page and README are very good and enticing to read: I want a Rublon!
Comment #30
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.