You are here

function coder_test in Coder 6

Helper function to run the review on the code snippet.

File

./coder.module, line 1676
Developer Module that assists with code review and version upgrade that supports a plug-in extensible hook system so contributed modules can define additional review standards.

Code

function coder_test($code, $type, $severity = SEVERITY_MINOR) {
  $coder_args = array(
    '#severity' => $severity,
    '#filename' => 'snippet',
    '#test' => $code,
  );
  _coder_read_and_parse_file($coder_args);
  $reviews = coder_reviews();
  $results = do_coder_review($coder_args, $reviews[$type]);
  unset($results['#stats']);
  return $results;
}