Sejmometr api module integrates api published by sejmometr.pl.
It works as cron job and creates related nodes:
- member of parliament information
- member of parliament financial statements
- member of parliament financial benefits reports
- parliament sessions
- day of parliament session
- session transcripts
- items of agenda
- parliament considerations
- parliament speeches
- documents created by parliament of Poland

You also have ability to limit how many nodes are created in one cron run.

Project page: http://drupal.org/sandbox/hmach/1429092
Git: git.drupal.org:sandbox/hmach/1429092.git
Version: Drupal 6

CommentFileSizeAuthor
#5 review.txt29.85 KBalex dicianu

Comments

eugene.ilyin’s picture

Hello! How I can review your module? Please add link to repository of your project.

hmach’s picture

Here it goes!
git.drupal.org:sandbox/hmach/1429092.git

hmach’s picture

klausi’s picture

Please also add the sandbox link to the issue summary.

The response time for a review is now approaching 4 weeks. Get a review bonus and we will come back to your application sooner.

alex dicianu’s picture

Status: Needs review » Needs work
StatusFileSize
new29.85 KB

Hi
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-1.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.

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

See report attached.
You should also specify if the module is for drupal 7 or 6.

Looking on the project page, I think you should add more details about your module, maybe a screenshot if possible. Here is an example: http://drupal.org/project/pathauto.

Looking into the code, I saw that you don't have a @doc block for your functions. You should add one for each function, here is the proper format http://drupal.org/node/1354.

.install file
Here you should avoid using the t() function. Use this one instead http://api.drupal.org/api/drupal/includes!install.inc/function/st/7. Here is the reason: Used during the install process, when database, theme, and localization system is possibly not yet available.
Line 309:
$filename = drupal_get_path('module', 'sejmometr_api') . "/includes/cck/parliament_club.inc";
A better way would be to use this function module_load_include().

.module file
Line 468: Instead of file_get_contents() you should use drupal_http_request(). It's a more proper way to get the url.

hmach’s picture

All required and suggested changes are made.
Exept:

You should also specify if the module is for drupal 7 or 6.

Do You want it to be placed on projects page? Then what if I'll create module for 7.x version?
Isn't branch name and information in .info file enough?

alex dicianu’s picture

Status: Needs work » Needs review

Hi,
What I meant was, from this page http://drupal.org/node/1011698 point 4-5. Offcourse I saw the branch name and .info file, but it's just easyer for someone who want's to checkout your module to know if he/she should do it in a drupal 6 or 7 installation.
PS: changed the status to needs review to get a review ;)

alex dicianu’s picture

Issue summary: View changes

Project page link and repository info

hmach’s picture

Ok, now got it :)

hmach’s picture

Issue summary: View changes

Version info

hmach’s picture

Automatic review of code reports an error:

The second argument to watchdog() should not be enclosed with t()

In documentation of watchdog() function there is no information about not using t(). What's more, there is info how it should be used.
In coding standards I could not find why it is treated as error?
Any help?

prashantgoel’s picture

Status: Needs review » Needs work

Review of the 6.x-1.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.

Severity minor, Drupal Commenting Standards, Internationalization, Drupal Security Checks, Drupal SQL Standards, Drupal Coding Standards

sites/all/modules/pareview_temp/./test_candidate/sejmometr_api.install:
 +413: [normal] The $message argument to drupal_set_message() should be enclosed within t() so that it is translatable.
 +414: [normal] The $message argument to drupal_set_message() should be enclosed within t() so that it is translatable.

Status Messages:
 Coder found 27 projects, 27 files, 2 normal warnings, 0 warnings were flagged to be ignored

FILE: ...iew/sites/all/modules/pareview_temp/test_candidate/sejmometr_api.module
--------------------------------------------------------------------------------
FOUND 7 ERROR(S) AFFECTING 7 LINE(S)
--------------------------------------------------------------------------------
   16 | ERROR | File doc comments must be followed by a blank line.
   92 | ERROR | More than 2 empty lines are not allowed
  884 | ERROR | Additional blank line found at the end of doc comment
 1218 | ERROR | Inline comments must end in  full-stops, exclamation marks, or
      |       | question marks
 1780 | ERROR | Inline comments must end in  full-stops, exclamation marks, or
      |       | question marks
 2243 | ERROR | There must be no blank line following an inline comment
 2687 | ERROR | Files must end in a single new line character
--------------------------------------------------------------------------------

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

hmach’s picture

Status: Needs work » Needs review

Fixed.

SebCorbin’s picture

Status: Needs review » Needs work

Here is my manual review:

Personnally I don't get the point to create a sejmometr_api_conf table when you have the variables table.
All your submodules have no code, all the .inc files in your submodules are missing <?php tag at the beginning.

Here's what PHPStorm told me when opening you project:
Undefined constant WATCHDOG_WARN in file sejmometr_api.module
Undefined variable 'user' in file sejmometr_api.module:1123
Undefined variable 'session_day' in file sejmometr_api.module:1493
Variable 'mp' might have not been defined in file sejmometr_api.module:2264
Undefined variable 'si' in file sejmometr_api.module:2664
Undefined variable 's_info' in file sejmometr_api.module:2667
Unused local variable $doc_url in file sejmometr_api.module
Unused local variable $user in file sejmometr_api.module
Unused local variable $user in file sejmometr_api.module
Unused local variable $url in file sejmometr_api.module
Unused local variable $s in file sejmometr_api.module

hmach’s picture

Status: Needs work » Needs review

sejmometr_api_conf table (also) keeps ids of last processed documents. They are updated with every created node. Thus it is not good idea to keep that kind of data in variables table.
Yes, keeping just config variables can be done in variables table, but as far as they are used in conjunction with last ids this limits db queries to 1 query instead of X queries for each variable plus queries for last ids.
Submodules have no code, because they are helper modules responsible for creating content types. Creating new content types can be done in main module but - creating new content type for CCK is time consuming operation. Some hosting companies restrict processor time and/or have short time for script to be executed. This can lead to timeout when instaling module. Then You can have module installed, but required content types may not be present.
All .inc files in submodules are missing <?php tag at beginning because they are import files for CCK.
Code variable issues are fixed.

misc’s picture

Status: Needs review » Needs work

I do not really get the explanation above - why is there import files for cck, and why are they missing <?php tags? And why have the submodles no code in them? These seem to be so specific code that it can not be a generic module, are am I missing something here?

klausi’s picture

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

Closing due to lack of activity. Feel free to reopen if you are still working on this application.

klausi’s picture

Issue summary: View changes

Update - info about new nodes