Esempio n. 1
0
 public function apply(PHPUnit_Util_Metrics $metrics)
 {
     $crap = $metrics->getCrapIndex();
     if ($crap >= $this->threshold) {
         return sprintf("The CRAP index is %d.\n" . 'The Change Risk Analysis and Predictions (CRAP) index of a ' . 'function or method uses cyclomatic complexity and code coverage ' . 'from automated tests to help estimate the effort and risk ' . 'associated with maintaining legacy code. A CRAP index over 30 ' . 'is a good indicator of crappy code.', $crap);
     }
 }