The ICA Survey module is a module that implements an API for building surveys. By default it comes with some modules that can be used to start building surveys without writing a single line of code, displaying them to users and capturing the results, but, more importantly, it also comes with a large number of hooks other modules can implement to define new question types (currently the module comes with open questions, multiple choice questions and checkbox questions), new methods for displaying results (by default the module simply displays all answers to all questions in a table, but it also comes with an extra module that aggragates the results so administrators can see how many times a single answer was chosen, for example). All of these hooks are documented (see the file doc/hooks.html).

The ICA Survey module defines a page where surveys can be created / modified, a page where administrators can view the results, a page that displays a survey to users and a page that is displayed to users when their answers to a survey are saved.

Unlike current methods for creating surveys in Drupal, which, as far as I can tell, all rely on making site builders use the form builder API to build forms that just so happen to be surveys, the ICA Survey module has been designed from the start to build surveys according to an extremely simple, straightforward concept: surveys are series of questions that users must answer. The answers are stored in a table and modules that build on the ICA Survey module can process and display in some sort of sensible fashion.

The module was built because we, at the "Expertise Centrum Systeem Ontwikkeling" at the ICA Faculty of the HAN Vocational College in the Netherlands, needed a simple to use framework for building surveys. The ICA Survey module has been used to build a questionnaire that sends out recommendations to users based on their answers. Using current survey tools in Drupal would have made this fairly difficult. Using the ICA Survey module all we had to do to analyze answers and send out an e-mail message with recommendations based on these answers was to implement the ica_survey_results_saved hook.

The module can be found here: http://drupal.org/sandbox/rhmtts/1175318

CommentFileSizeAuthor
#9 ica_survey-coder.txt7.15 KBklausi

Comments

aspilicious’s picture

You should read the improved coding standards. [google drupal coding standards]
And there are functions with no doc blocks.

.po files are obsolete these days. Translation should take place in localize.drupal.org.

files[] should only contain files that have a class or interface in them. You don't have any of those. So you can leave that out.
Remove

aspilicious’s picture

Status: Needs review » Needs work
rhmtts’s picture

* All issues the coder module came up with have been fixed.
* All functions have doc blocks.
* All .po translation files have been removed. I suppose when this becomes an "official" module I can add the translation data to localize.drupal.org.
* All files[] lines have been removed

rhmtts’s picture

Status: Needs work » Needs review
tim.plunkett’s picture

Assigned: Unassigned » tim.plunkett

Got your email, will try to get to it soon. There is a huge backlog, sorry for the wait.

rhmtts’s picture

No problem, just knowing it didn't get lost in the void is enough :-)

Thanks!

klausi’s picture

Status: Needs review » Needs work

* what does "ICA" mean? why this module name? Ah I see, your faculty name it is.
* Git release branch missing, see http://drupal.org/node/1015226
* README.txt missing
* "Implementation of hook_menu" should be "Implements hook_menu().", see http://drupal.org/node/1354#hookimpl
* you could move the admin form to a ica_survey.admin.inc file
* you should use simpletest for your test cases, see http://drupal.org/simpletest-tutorial-drupal7
* "// extract data for the new question, if any" comments should start capitalized and end with a "."
* array formatting: the closing ")" should be on the same indentation level as the line that started it.
* module, line 927: what is this ";" for?

rhmtts’s picture

Status: Needs work » Needs review

- We use ICA as a prefix for all modules we develop ourselves to avoid namespace clashes. I'd be perfectly happy to drop it. There currently exists a project called Survey but it's obsolete.
- Git release branch created.
- README.txt moved from doc subdirectory to main dirctory.
- All "Implementation of hook_xxx" changed to "Implements hook_xxx"
- Admin functionality was moved to ica_survey.admin.inc.
- The tests have been rewritten to use simlpetest
- Comments have all been capitalized.
- All code has been reformatted.
- "Module, line 927 : what is this ";" for?" - I'm sorry but I don't know what you mean. I don't see any loose ; anywhere?

klausi’s picture

Status: Needs review » Needs work
StatusFileSize
new7.15 KB
  • wrong git branch name: "7.x-1.0-rc1" should be "7.x-1.x". Use git tags for specific versions
  • lines in README.txt should not exceed 80 characters
  • ica_survey_uninstall(): function is empty, so remove it
  • "// The page callback will set the title.": Comments should be on a separate line
  • ica_survey_theme(): hook doc block is wrong.
  • ica_survey_show_form(): do not add extra ";" at the end of foreach() loops or if constructs. They are not needed.
  • ica_survey_show_form(): "if ($is_even) {" is checked twice, why?
  • coder reports lots of style issues, see attachment (executed with "drush coder-review minor style ica_survey"). Please fix them.
rhmtts’s picture

I'm very sorry about the coder module style issues. Since entering the approval process I've taken to religiously running coder on all code I write, but not, apparently, on the module that is in the approval process itself. Sorry for wasting your time like this.

All style issues have been now fixed, except one:

+180: [minor] When labelling buttons, make it clear what the button does, "Submit" is too generic.

Because in this specific case "Submit" is exactly what it does (it submits a survey).

As far as the other issues you raised are concerned:
> wrong git branch name: "7.x-1.0-rc1" should be "7.x-1.x". Use git tags for specific versions

Fixed.

> lines in README.txt should not exceed 80 characters

Fixed.

> ica_survey_uninstall(): function is empty, so remove it

Fixed.

> "// The page callback will set the title.": Comments should be on a separate line

Fixed.

> ica_survey_theme(): hook doc block is wrong.

What does this mean, exactly? If you mean to change the doc to read "Implements hook_theme()." that has been fixed.

> ica_survey_show_form(): do not add extra ";" at the end of foreach() loops or if constructs. They are not needed.

The coder module does not complain, and taking them all out is a lot of (manual) work that I'd rather not do if I don't have to :-) Is this really such a big problem?

> ica_survey_show_form(): "if ($is_even) {" is checked twice, why?

Once to actually do what it's supposed to do, namely to set a class for even and odd rows. The second time it's checked to toggle it. I agree it's verbose but at least it keeps things that don't belong together separate (IMHO).

rhmtts’s picture

Status: Needs work » Needs review
doitDave’s picture

Status: Needs review » Needs work

Hi, a quick glance at your repo:

There is still a branch named 7.x-1.0-rc1. You should really delete this branch and make sure to only work on the major release branch to avoid confusion. Same for the contents in the master branch, you better empty that branch and replace its content with a short readme like described in http://drupal.org/node/1127732 (step 5).

Review of the 7.x-1.x branch:

  • Run coder to check your style, some issues were found (please check the Drupal coding standards):
    Severity minor, Drupal Commenting Standards, Internationalization, Drupal Security Checks, Drupal SQL Standards, Drupal Coding Standards
    
    sites/all/modules/pareview_temp/test_candidate/ica_survey.module:
     +42: [minor] There should be no trailing spaces
     +184: [minor] When labelling buttons, make it clear what the button does, "Submit" is too generic.
    
    Status Messages:
     Coder found 1 projects, 1 files, 2 minor warnings, 0 warnings were flagged to be ignored
    
  • ./contrib/ica_survey_question_checkboxes/ica_survey_question_checkboxes.module: comment lines should break at 80 characters, see http://drupal.org/node/1354#general
      // empty values are ok as far as the database is concerned, so no further checking is necessary
    
  • ./contrib/ica_survey_question_multiple_choice/ica_survey_question_multiple_choice.module: comment lines should break at 80 characters, see http://drupal.org/node/1354#general
      // empty values are ok as far as the database is concerned, so no further checking is necessary
    
  • ./ica_survey.functions.inc: comment lines should break at 80 characters, see http://drupal.org/node/1354#general
      // check if the supplied properties can be traced back to an existing questiontype
    
  • ./ica_survey.admin.inc: comment lines should break at 80 characters, see http://drupal.org/node/1354#general
      // Pass every  question to relevant hook_editform_validate and hook_editform_save.
    
  • Comments should be on a separate line before the code line, see http://drupal.org/node/1354#inline
    ./ica_survey.admin.inc:502:    if (! is_array($question) ) { // Fieldset, title (neither of which we care about).
    ./ica_survey.admin.inc:550:        '', // This will be filled with the draggable.
    ./ica_survey.module:255:  $_SESSION['ica_survey_survey_was_submitted'] = TRUE; // Allows implementations of hook_ica_survey_results_saved to know when the survey form was actually submitted again.
    
  • ./contrib/ica_survey_question_open/ica_survey_question_open.install: all functions should have doxygen doc blocks, see http://drupal.org/node/1354#functions
    
    function ica_survey_question_open_install() {
    
  • ./contrib/ica_survey_question_checkboxes/ica_survey_question_checkboxes.module: all functions should have doxygen doc blocks, see http://drupal.org/node/1354#functions
    
    function _ica_survey_question_checkboxes_save_answer($question_id, $answer) {
    
  • ./contrib/ica_survey_question_multiple_choice/ica_survey_question_multiple_choice.module: all functions should have doxygen doc blocks, see http://drupal.org/node/1354#functions
    
    function _ica_survey_question_multiple_choice_save_answer($question_id, $answer) {
    
  • ./contrib/ica_survey_question_multiple_choice/ica_survey_question_multiple_choice.install: all functions should have doxygen doc blocks, see http://drupal.org/node/1354#functions
    
    function ica_survey_question_multiple_choice_install() {
    
  • There should be a space before and after operators like ==, ===, && and ||. See http://drupal.org/node/318#controlstruct
    ica_survey.test:52:    if ((count($result) == 1 )&& property_exists($result[0], 'questions') && (count($result[0]->questions) == 0)) {
    
  • Assignments should have a space before and after the operator, see http://drupal.org/node/318#operators
    ./ica_survey.functions.inc:27:      $operator = '=';
    ./ica_survey.functions.inc:141:      $operator = '=';
    ./ica_survey.functions.inc:312:      $operator = '=';
    ./ica_survey.functions.inc:410:      $operator = '=';
    
  • All text files should end in a single newline (\n). See http://drupal.org/node/318#indenting
    ./contrib/ica_survey_question_open/ica_survey_question_open.info ./contrib/ica_survey_display_answers/ica_survey_display_answers.info ./contrib/ica_survey_display_answers/ica_survey_display_answers.module ./contrib/ica_survey_question_email/ica_survey_question_email.install ./contrib/ica_survey_question_email/ica_survey_question_email.info ./contrib/ica_survey_question_checkboxes/ica_survey_question_checkboxes.info ./contrib/ica_survey_question_checkboxes/ica_survey_question_checkboxes.install ./contrib/ica_survey_question_checkboxes/ica_survey_question_checkboxes.module ./contrib/ica_survey_result_aggregate/ica_survey_result_aggregate.info ./contrib/ica_survey_question_multiple_choice/ica_survey_question_multiple_choice.info ./contrib/ica_survey_question_multiple_choice/ica_survey_question_multiple_choice.module ./contrib/ica_survey_question_multiple_choice/ica_survey_question_multiple_choice.install ./README.txt ./ica_survey.install ./js/ica_survey.js ./ica_survey.info ./ica_survey.functions.inc ./ica_survey.module
    

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

Manual review:

  • The two last points of the review IMO are false positives. Manual spot checks found no errors.

As for your recent comments:

Because in this specific case "Submit" is exactly what it does (it submits a survey).

So why not just name it "submit survey"? Background: Someone might alter your form. This actually happens quite often, btw ;). What if someone else comes along with a botton like "save"? Then your user sits in front of the form and thinks "ok. submit or save?". Out of question: "save" would also not be good style, but I'm sure at least you would want to provide the more sophisticated button in such cases ;)

The coder module does not complain, and taking them all out is a lot of (manual) work that I'd rather not do if I don't have to :-) Is this really such a big problem?

Counter question: Is running a regex such a big problem? Actually you would not even need a regex but a simple search/replace pattern here ;)

$is_even

I think this implementation is up to you. But you would have your code far cleaner with $is_even = !$is_even; without any different result. Just to mention it ;)

rhmtts’s picture

Status: Needs work » Needs review

OK. Master branch has been cleaned up, rc1 branch has been deleted, all coder issues fixed except for the warning about files not ending in a new line because the files do, in fact, end in newlines so I'm not sure what it's complaining about.

doitDave’s picture

Hi,

yes, automated checks look good and I can confirm that there are newlines. So formal issues seem fixed, please give me (or anyone else) some time for an in-depth manual review (as there's much code). :)

doitDave’s picture

Status: Needs review » Needs work

OK, some first results after a test run and some code diving:

  • Your admin section is being placed as a top level item. IMO that's not compliant with http://drupal.org/node/549094 as of which I would see your config settings below "configuration > " (yes, and then where?). Anyhow I'm sure that the current place does not really meet the ideas behind the interface changes introduced with D7 ;)
  • Next, I have tried to create a new survey. I named it "test"/"testname". After clicking on "create survey", I am being taken to admin/survey/test and receive success message ("has been created") but also an error message: "no such survey". Obviously there is some logical error in your drupal_goto as "admin/survey/1" would be correct here.
  • Once I am there, I want to add a "multiple choice" question. I enter some test question in the first field, check "required" and click "add question". This takes me back to admin/surveys/1 without any visible changes and also without any form error telling me what I probably missed out. Even more irritating: Below the inputs for question one appears a new input for question 2. If I fill in the second question, THIS one is being saved. Other than question 1 which disappears. So I am really unsure why this all comes up. I fail using it intuitively but also there is no description as a hint for me how to do it properly :-(

Maybe you would like to check on these few initial points first and do some more tests? If I can be of assistance, just let me know :)

Edit: Personal addition, maybe a question of individual taste: You are introducing 6 modules in one package with cascading dependencies. To deactivate the entire package, it takes three cycles. For deinstallation another three, six in total which I personally find really much. I would recommend to make sure that this logic is without alternative, which means, does it make any sense at all to activate only the basic module? Is there any value in a survey if not even "question type open" is activated anyway? In other words: If there's no real good reason to split a module into submodules (which I cannot judge after the first look) that should be avoided.

rhmtts’s picture

Status: Needs work » Needs review

* The admin section is now in admin/config/survey. None of the groups under config listed on http://drupal.org/node/549094 seemed to fit, so I created a new group.
* Fixed.
* Error messages have been added for when users create a question without a question text, which is what seemed to have happened in your example.

As far as the 6 modules are concerned: while you're correct that a survey without a single question type has no value, it should be possible to deactivate all question types, which is why even "question type open" is not part of the core module.

Looking over the six dependent modules again and with, hopefully, fresher eyes, I still don't see any one for which enabling by default makes sense.

I understand your distate for this setup and I even share it, but in this case I see no way around it (other than creating a basic survey configuration page where question types, some of which come from separate modules, can be enabled or disabled, which I personally find distasteful, if only because it leads to more complicated code).

osman’s picture

Status: Needs review » Needs work

Code Review

Review of the 7.x-1.x branch:

  • Drupal Code Sniffer has found some code style issues (please check the Drupal coding standards):
    
    FILE: ...te/contrib/ica_survey_display_answers/ica_survey_display_answers.module
    --------------------------------------------------------------------------------
    FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
    --------------------------------------------------------------------------------
     25 | ERROR | Comments may not appear after statements.
    --------------------------------------------------------------------------------
    
    
    FILE: ...b/ica_survey_question_checkboxes/ica_survey_question_checkboxes.install
    --------------------------------------------------------------------------------
    FOUND 2 ERROR(S) AND 1 WARNING(S) AFFECTING 2 LINE(S)
    --------------------------------------------------------------------------------
     23 | ERROR   | Inline comments must start with a capital letter
     23 | ERROR   | Inline comments must end in  full-stops, exclamation marks, or
        |         | question marks
     62 | WARNING | A comma should follow the last multiline array item. Found: )
    --------------------------------------------------------------------------------
    
    
    FILE: ...ib/ica_survey_question_checkboxes/ica_survey_question_checkboxes.module
    --------------------------------------------------------------------------------
    FOUND 26 ERROR(S) AFFECTING 18 LINE(S)
    --------------------------------------------------------------------------------
      20 | ERROR | Expected 0 spaces before closing bracket; 1 found
      35 | ERROR | No space before comment text; expected "// $answer['question'] =
         |       | $values['question'];" but found "//$answer['question'] =
         |       | $values['question'];"
     114 | ERROR | Inline comments must start with a capital letter
     139 | ERROR | Inline comments must start with a capital letter
     152 | ERROR | Expected 0 spaces before closing bracket; 1 found
     157 | ERROR | Expected 0 spaces before closing bracket; 1 found
     162 | ERROR | Inline comments must start with a capital letter
     162 | ERROR | Inline comments must end in  full-stops, exclamation marks, or
         |       | question marks
     168 | ERROR | Inline comments must start with a capital letter
     168 | ERROR | Inline comments must end in  full-stops, exclamation marks, or
         |       | question marks
     192 | ERROR | Inline comments must start with a capital letter
     192 | ERROR | Inline comments must end in  full-stops, exclamation marks, or
         |       | question marks
     224 | ERROR | Inline comments must start with a capital letter
     224 | ERROR | Inline comments must end in  full-stops, exclamation marks, or
         |       | question marks
     257 | ERROR | Inline comments must start with a capital letter
     257 | ERROR | Inline comments must end in  full-stops, exclamation marks, or
         |       | question marks
     260 | ERROR | Expected 0 spaces before closing bracket; 1 found
     281 | ERROR | More than 2 empty lines are not allowed
     321 | ERROR | Inline comments must start with a capital letter
     322 | ERROR | Inline comments must end in  full-stops, exclamation marks, or
         |       | question marks
     322 | ERROR | There must be no blank line following an inline comment
     333 | ERROR | Inline comments must start with a capital letter
     333 | ERROR | Inline comments must end in  full-stops, exclamation marks, or
         |       | question marks
     338 | ERROR | Inline comments must start with a capital letter
     338 | ERROR | Inline comments must end in  full-stops, exclamation marks, or
         |       | question marks
     339 | ERROR | Expected "}\nelse {\n"; found "}\n  // inserting\n\nelse{\n"
    --------------------------------------------------------------------------------
    
    
    FILE: ...ate/contrib/ica_survey_question_email/ica_survey_question_email.install
    --------------------------------------------------------------------------------
    FOUND 0 ERROR(S) AND 1 WARNING(S) AFFECTING 1 LINE(S)
    --------------------------------------------------------------------------------
     5 | WARNING | Line exceeds 80 characters; contains 83 characters
    --------------------------------------------------------------------------------
    
    
    FILE: ...date/contrib/ica_survey_question_email/ica_survey_question_email.module
    --------------------------------------------------------------------------------
    FOUND 3 ERROR(S) AFFECTING 2 LINE(S)
    --------------------------------------------------------------------------------
     71 | ERROR | Constants must be uppercase; expected
        |       | ICA_SURVEY_QUESTION_OPEN_ICA_SURVEY_QUESTION_TYPE_OPEN_EDITFORM_DELETE
        |       | but found
        |       | ica_survey_question_open_ica_survey_question_type_open_editform_delete
     75 | ERROR | Files must end in a single new line character
     75 | ERROR | More than 2 empty lines are not allowed
    --------------------------------------------------------------------------------
    
    
    FILE: ...ey_question_multiple_choice/ica_survey_question_multiple_choice.install
    --------------------------------------------------------------------------------
    FOUND 2 ERROR(S) AND 1 WARNING(S) AFFECTING 2 LINE(S)
    --------------------------------------------------------------------------------
     22 | ERROR   | Inline comments must start with a capital letter
     22 | ERROR   | Inline comments must end in  full-stops, exclamation marks, or
        |         | question marks
     61 | WARNING | A comma should follow the last multiline array item. Found: )
    --------------------------------------------------------------------------------
    
    
    FILE: ...vey_question_multiple_choice/ica_survey_question_multiple_choice.module
    --------------------------------------------------------------------------------
    FOUND 26 ERROR(S) AFFECTING 18 LINE(S)
    --------------------------------------------------------------------------------
      21 | ERROR | Expected 0 spaces before closing bracket; 1 found
      36 | ERROR | No space before comment text; expected "// $answer['question'] =
         |       | $values['question'];" but found "//$answer['question'] =
         |       | $values['question'];"
      51 | ERROR | No space before comment text; expected "//
         |       | $inputs['question']['#required'] = TRUE;" but found
         |       | "//$inputs['question']['#required'] = TRUE;"
     114 | ERROR | Inline comments must start with a capital letter
     139 | ERROR | Inline comments must start with a capital letter
     152 | ERROR | Expected 0 spaces before closing bracket; 1 found
     157 | ERROR | Expected 0 spaces before closing bracket; 1 found
     162 | ERROR | Inline comments must start with a capital letter
     162 | ERROR | Inline comments must end in  full-stops, exclamation marks, or
         |       | question marks
     168 | ERROR | Inline comments must start with a capital letter
     168 | ERROR | Inline comments must end in  full-stops, exclamation marks, or
         |       | question marks
     192 | ERROR | Inline comments must start with a capital letter
     192 | ERROR | Inline comments must end in  full-stops, exclamation marks, or
         |       | question marks
     224 | ERROR | Inline comments must start with a capital letter
     224 | ERROR | Inline comments must end in  full-stops, exclamation marks, or
         |       | question marks
     257 | ERROR | Inline comments must start with a capital letter
     257 | ERROR | Inline comments must end in  full-stops, exclamation marks, or
         |       | question marks
     260 | ERROR | Expected 0 spaces before closing bracket; 1 found
     281 | ERROR | More than 2 empty lines are not allowed
     321 | ERROR | Inline comments must start with a capital letter
     322 | ERROR | Inline comments must end in  full-stops, exclamation marks, or
         |       | question marks
     322 | ERROR | There must be no blank line following an inline comment
     333 | ERROR | Inline comments must start with a capital letter
     333 | ERROR | Inline comments must end in  full-stops, exclamation marks, or
         |       | question marks
     338 | ERROR | Inline comments must start with a capital letter
     338 | ERROR | Inline comments must end in  full-stops, exclamation marks, or
         |       | question marks
    --------------------------------------------------------------------------------
    
    
    FILE: ...idate/contrib/ica_survey_question_open/ica_survey_question_open.install
    --------------------------------------------------------------------------------
    FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
    --------------------------------------------------------------------------------
     17 | ERROR | Files must end in a single new line character
    --------------------------------------------------------------------------------
    
    
    FILE: ...didate/contrib/ica_survey_question_open/ica_survey_question_open.module
    --------------------------------------------------------------------------------
    FOUND 5 ERROR(S) AFFECTING 4 LINE(S)
    --------------------------------------------------------------------------------
      20 | ERROR | Expected 0 spaces before closing bracket; 1 found
      69 | ERROR | Expected 0 spaces before closing bracket; 1 found
      74 | ERROR | Expected 0 spaces before closing bracket; 1 found
     124 | ERROR | Files must end in a single new line character
     124 | ERROR | More than 2 empty lines are not allowed
    --------------------------------------------------------------------------------
    
    
    FILE: .../contrib/ica_survey_result_aggregate/ica_survey_result_aggregate.module
    --------------------------------------------------------------------------------
    FOUND 3 ERROR(S) AFFECTING 3 LINE(S)
    --------------------------------------------------------------------------------
      94 | ERROR | Missing function doc comment
     100 | ERROR | Missing function doc comment
     107 | ERROR | Files must end in a single new line character
    --------------------------------------------------------------------------------
    
    
    FILE: ...iew/sites/all/modules/pareview_temp/test_candidate/ica_survey.admin.inc
    --------------------------------------------------------------------------------
    FOUND 12 ERROR(S) AND 1 WARNING(S) AFFECTING 12 LINE(S)
    --------------------------------------------------------------------------------
     118 | ERROR   | More than 2 empty lines are not allowed
     243 | ERROR   | More than 2 empty lines are not allowed
     294 | ERROR   | Expected 0 spaces before closing bracket; 1 found
     412 | ERROR   | Expected 0 spaces before closing bracket; 1 found
     439 | ERROR   | There must be no blank line following an inline comment
     463 | ERROR   | Expected 0 spaces before closing bracket; 1 found
     487 | ERROR   | Missing parameter type at position 1
     504 | ERROR   | Expected 0 spaces before closing bracket; 1 found
     516 | ERROR   | Expected 0 spaces before closing bracket; 1 found
     621 | WARNING | Line exceeds 80 characters; contains 102 characters
     621 | ERROR   | Comments may not appear after statements.
     660 | ERROR   | Missing parameter type at position 1
     701 | ERROR   | Files must end in a single new line character
    --------------------------------------------------------------------------------
    
    
    FILE: ...sites/all/modules/pareview_temp/test_candidate/ica_survey.functions.inc
    --------------------------------------------------------------------------------
    FOUND 42 ERROR(S) AND 1 WARNING(S) AFFECTING 37 LINE(S)
    --------------------------------------------------------------------------------
      12 | ERROR   | Missing parameter type at position 1
      15 | ERROR   | Data type of return value is missing
      29 | ERROR   | Expected 0 spaces before closing bracket; 1 found
      54 | ERROR   | Missing parameter type at position 1
      57 | ERROR   | Data type of return value is missing
      69 | ERROR   | Inline comments must start with a capital letter
      69 | ERROR   | Inline comments must end in  full-stops, exclamation marks, or
         |         | question marks
     104 | ERROR   | Inline comments must start with a capital letter
     104 | ERROR   | Inline comments must end in  full-stops, exclamation marks, or
         |         | question marks
     126 | ERROR   | Missing parameter type at position 1
     129 | ERROR   | Data type of return value is missing
     143 | ERROR   | Expected 0 spaces before closing bracket; 1 found
     166 | ERROR   | Expected 0 spaces before closing bracket; 1 found
     183 | ERROR   | More than 2 empty lines are not allowed
     192 | ERROR   | Missing parameter type at position 1
     195 | ERROR   | Data type of return value is missing
     207 | ERROR   | Inline comments must start with a capital letter
     207 | ERROR   | Inline comments must end in  full-stops, exclamation marks, or
         |         | question marks
     217 | ERROR   | Inline comments must start with a capital letter
     219 | ERROR   | Space before closing parenthesis of function call prohibited
     223 | ERROR   | Inline comments must start with a capital letter
     223 | ERROR   | Inline comments must end in  full-stops, exclamation marks, or
         |         | question marks
     226 | WARNING | The closing paranthesis of an array should not be preceded by
         |         | a white space
     269 | ERROR   | Missing parameter type at position 1
     272 | ERROR   | Data type of return value is missing
     298 | ERROR   | Missing parameter type at position 1
     301 | ERROR   | Data type of return value is missing
     314 | ERROR   | Expected 0 spaces before closing bracket; 1 found
     338 | ERROR   | Missing parameter type at position 1
     341 | ERROR   | Data type of return value is missing
     353 | ERROR   | Inline comments must start with a capital letter
     354 | ERROR   | Inline comments must end in  full-stops, exclamation marks, or
         |         | question marks
     397 | ERROR   | Missing parameter type at position 1
     400 | ERROR   | Data type of return value is missing
     413 | ERROR   | Expected 0 spaces before closing bracket; 1 found
     437 | ERROR   | Missing parameter type at position 1
     440 | ERROR   | Missing parameter type at position 2
     443 | ERROR   | Data type of return value is missing
     448 | ERROR   | Expected 0 spaces before closing bracket; 1 found
     478 | ERROR   | Inline comments must start with a capital letter
     478 | ERROR   | Inline comments must end in  full-stops, exclamation marks, or
         |         | question marks
     487 | ERROR   | Inline comments must start with a capital letter
     487 | ERROR   | Inline comments must end in  full-stops, exclamation marks, or
         |         | question marks
    --------------------------------------------------------------------------------
    
    
    FILE: ...eview/sites/all/modules/pareview_temp/test_candidate/ica_survey.install
    --------------------------------------------------------------------------------
    FOUND 6 ERROR(S) AND 4 WARNING(S) AFFECTING 7 LINE(S)
    --------------------------------------------------------------------------------
      15 | ERROR   | Inline comments must start with a capital letter
      15 | ERROR   | Inline comments must end in  full-stops, exclamation marks, or
         |         | question marks
      44 | WARNING | A comma should follow the last multiline array item. Found: )
      47 | ERROR   | Inline comments must start with a capital letter
      47 | ERROR   | Inline comments must end in  full-stops, exclamation marks, or
         |         | question marks
      74 | WARNING | A comma should follow the last multiline array item. Found:
         |         | 'open'
      92 | WARNING | A comma should follow the last multiline array item. Found: )
     116 | ERROR   | Inline comments must start with a capital letter
     116 | ERROR   | Inline comments must end in  full-stops, exclamation marks, or
         |         | question marks
     145 | WARNING | A comma should follow the last multiline array item. Found: )
    --------------------------------------------------------------------------------
    
    
    FILE: ...review/sites/all/modules/pareview_temp/test_candidate/ica_survey.module
    --------------------------------------------------------------------------------
    FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
    --------------------------------------------------------------------------------
     122 | ERROR | Space before closing parenthesis of function call prohibited
    --------------------------------------------------------------------------------
    
    
    FILE: ...pareview/sites/all/modules/pareview_temp/test_candidate/ica_survey.test
    --------------------------------------------------------------------------------
    FOUND 11 ERROR(S) AFFECTING 10 LINE(S)
    --------------------------------------------------------------------------------
      9 | ERROR | "require_once" is a statement not a function; no parentheses are
        |       | required
     13 | ERROR | Missing function doc comment
     21 | ERROR | Missing function doc comment
     25 | ERROR | Missing function doc comment
     53 | ERROR | Whitespace found at end of line
     73 | ERROR | An operator statement must be followed by a single space
     73 | ERROR | There must be a single space before an operator statement
     83 | ERROR | Expected 0 spaces after opening bracket; 1 found
     92 | ERROR | More than 2 empty lines are not allowed
     96 | ERROR | More than 2 empty lines are not allowed
     99 | ERROR | Files must end in a single new line character
    --------------------------------------------------------------------------------
    
    
    FILE: ...areview/sites/all/modules/pareview_temp/test_candidate/js/ica_survey.js
    --------------------------------------------------------------------------------
    FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
    --------------------------------------------------------------------------------
     13 | ERROR | Expected 0 spaces before closing bracket; 1 found
    --------------------------------------------------------------------------------
    
    
    FILE: ...areview_temp/test_candidate/theme/ica-survey-admin-view-results.tpl.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
    --------------------------------------------------------------------------------
     22 | ERROR | Files must end in a single new line character
    --------------------------------------------------------------------------------
    

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

Source: http://ventral.org/pareview - PAReview.sh online service

rhmtts’s picture

Status: Needs work » Needs review

It's great that a new version of pareview.sh catches more spaces and comment capitalization issues than previous versions (I'm 100% sure the last time I ran this through pareviews.sh all it did was incorrectly complain about missing newlines at the end of some files)

Of course I'm perfectly willing to address real, significant issues such as the ones raised in #16, but flagging things like "More than 2 empty lines are not allowed" as an error is, IMHO, ridiculous.

Could someone please review the contents of the module first before running it through yet another automated style tester with constantly revised settings. Since submitting this module more than half a year ago I've had to make it conform to four different style testers. Only once did someone actually look at what the module does. I'm about ready to give up on it, to be honest.

raynimmo’s picture

I feel your pain, remember though that you can run the automated tester at http://ventral.org/pareview yourself and address issues when they come up.

The online PAReview service that patrickd setup seems to be pretty up to date with the latest standards so you should maybe follow the output from that. He has also created a module in his sandbox so that you can use your own server to do the code review.

rhmtts’s picture

Right, so I ran pareview on november 24th and everything was fine, except the new line at the end of the file issue that was decided to be a false positive (see #14 above).

It's great that pareview.sh has since been changed to catch more, but it's unrealistic to expect people to keep up with every single change. And looking over the "issues" it comes up with there's nothing there that I think requires fixing before an actual human looks at the code to see what it actually does.

raynimmo’s picture

Status: Needs review » Needs work

The PAReview script is still a sandbox project and thus is liable to change and/or false positives. Klausi is constantly updating the script to include new checks and refine previous ones. Just a quick glance at his commit log for it shows that there has been numerous commits since November 24th. In essence this means that it will now detect errors that it previously overlooked.

He also seems to be transferring a lot of tests over to Drupal Code Sniffer as the PAReview script works in conjunction with that and a host of other testing modules.

I understand your frustration, my own projects review also has recently shown errors that where previously not reported on by the scripts but we have to take this opportunity as a learning experience and try not to get too upset by the evolving test results.

You should really use the online service as it really is a good quick way of checking your code if you do not have the appropriate testing environment installed.

The current implementation shows quite a large number of errors and warnings against your current codebase, see yourself at http://ventral.org/pareview/httpgitdrupalorgsandboxrhmtts1175318git-7x-1x. You should ensure you have thoroughly read and understood the Drupal Coding Standards and the Doxygen and comment formatting conventions whilst referencing the lines highlighted by the online review script.

Many reviewers will not attempt a manual review unless the code is clean and tested already through one of the automated testing environments. This ensures that they only have to search for security issues and common errors within function declarations.

As well as the 'More than 2 empty lines' issue, the tests are flagging errors such as incorrectly formatted functions, missing return parameters, missing data types, incorrectly formatted comments, incorrectly positioned comments, missing comma's in multiline arrays and incorrectly nested if/else statements to name but a few.

I feel that Osman was quite right to set this to 'needs work' in comment #17 and I have done the same.

rhmtts’s picture

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

Right. I have better things to do than to conform to the constantly changing whims of an automatic code validation script.

jthorson’s picture

Just soliciting process feedback ... I understand your frustration, but would you have preferred it if you received no feedback for a few months, and then suddenly a manual review; as opposed to the frequent coding style update comments?

I'm not being sarcastic here ... just trying to get a sense of whether the current experience is better or worse than what applicants were going through roughly 8 months ago; with full understanding that neither is ideal.

rhmtts’s picture

The issue is not that there are frequent coding style update comments per se, the issue is that the coding style *changed*. At one point this module passed the automated coding tests. Then all of a sudden it didn't (which was, imho, incorrect, too).

I can't keep fixing code because some flaky automated testing script changes all the time. Once or twice to test if you're serious: ok. But once that is done, please look at the contents of the module (which is what this should be all about, after all - coding style is just cosmetics and can be changed easily).

I'm all for contributing our custom modules, which are written to be as generic as possible, back to the community and so is my boss, but all this red tape is taking up too much of our time and I can't justify that, neither to my boss nor to our clients.

So in this sense, I feel the process has gotten worse. In the old way it took a long time for someone to take a look at your code but at least the feedback, once you got it, was meaningful. The feedback you get now is, first of all, meaningless and second of all so frequent it's frustrating rather than helpful.

My suggestion to make the process less off-putting would be: run it through an automated style tester ONCE, then, if most, if not all style issues have been fixed, have a real live human test the module, give feedback about the contents of the module and at some point, based merely on the contents of the module, decide whether it's accepted or not. Only then should any last remaining coding style issues be resolved, with the full understanding that once they are, the module goes in.

Just my 2 cents.

Thanks for your interest.

jthorson’s picture

Thanks rhmtts, that's the sort of feedback I was looking for. :)

avpaderno’s picture

Title: ICA Survey » [D7] ICA Survey
Assigned: tim.plunkett » Unassigned