In order to do so we need coder D6 to be able to review D7 code in an external directory. This is necessary to ensure that changes to the code being tested (D7 currently) don't break coder review (as it is in D7 right now). Instead coder can run in the stable Drupal version as PIFR does and simply review external files.

I am not sure how we will deal with the false positives that may be generated, especially when we run this on contrib, so for now the coder tests will not be required to pass.

Preferably I would like to see something like:

$result = coder_review_run($directory, $options);
or
coder_review_run($directory, $options);
coder_review_results();

or whatever, but a nice clean API way to invoke it and run the reviews we want. I'll be dipping into the code to see what we have to work with, but one option that may be simplest since it won't require an interface or data storage mechanism to be written for qa.drupal.org would be to consider coder review items to be assertions and treat them like simpletest does.

If anything we can change the wording around so it doesn't say exception or whatever.

I would like to have a prototype of this not later then Dec. 11.

Comments

boombatower’s picture

boombatower’s picture

Assigned: Unassigned » boombatower

Seems that if I do something like the following and override the 'coder_warning_msg' theme function with something more fitting for qa.drupal.org I should be on my way.

$selected_reviews = array('comment', 'sql', 'i18n', 'style', 'security', 'coder_tough_love');

$reviews = _coder_reviews();
foreach ($reviews as $key => $review) {
  if (!in_array($key, $selected_reviews)) {
    unset($reviews[$key]);
  }
}

$php_extensions = array('inc', 'php', 'module', 'install', 'test');

$args = array(
  '#reviews' => $reviews,
  '#severity' => SEVERITY_MINOR,
  '#filename' => '/home/boombatower/software/drupal-7/index.php',
  '#patch' => '',
  '#php_extensions' => $php_extensions,
  '#include_extensions' => _coder_get_reviews_extensions($php_extensions, $reviews),
);
$results = do_coder_reviews($args);

I am working on writing the PIFR plugin, but that last challenge will be backporting D7 rules to D6. Should be easy if the API hasn't changed, but I am not sure there.

boombatower’s picture

My only remaining question is how to format the actual message since coder includes line number, file, and status in the actually message. PIFR won't want that since we will be displaying using assertion interface.

Not sure if message should also include chunk of code.

boombatower’s picture

Status: Active » Needs review
StatusFileSize
new7.33 KB

Initial implementation, which requires #654896: Refactor server plugin API.

boombatower’s picture

StatusFileSize
new7.61 KB

Updated integration.

boombatower’s picture

Project: Coder » Project Issue File Review
Status: Needs review » Fixed

Initial implementation committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.