You are here

function _coder_severity_name in Coder 5

Same name and namespace in other branches
  1. 5.2 coder.module \_coder_severity_name()
  2. 6.2 coder.module \_coder_severity_name()
  3. 6 coder.module \_coder_severity_name()
6 calls to _coder_severity_name()
do_coder_review_grep in ./coder.module
Searches for a string.
do_coder_review_grep_invert in ./coder.module
Searches for potentially missing string.
do_coder_review_regex in ./coder.module
_coder_50_callback in includes/coder_50.inc
Define the rule callbacks
_coder_6x_callback in includes/coder_6x.inc

... See full list

File

./coder.module, line 955
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_severity_name($coder_args, $review, $rule) {

  // NOTE: warnings in php includes are suspicious because
  // php includes are frequently 3rd party products
  if (isset($coder_args['#php_minor']) && substr($coder_args['#filename'], -4) == '.php') {
    return 'minor';
  }

  // get the severity as defined by the rule
  if (isset($rule['#severity'])) {
    return $rule['#severity'];
  }

  // if it's not defined in the rule, then it can be defined by the review
  if (isset($review['#severity'])) {
    return $review['#severity'];
  }

  // use the default
  return 'normal';
}