Example #1
0
 protected function doRenderItemObject(PHP_CodeCoverage_Report_HTML_Node $item, $lowUpperBound, $highLowerBound, $link = NULL, $itemClass = 'coverItem')
 {
     return $this->doRenderItem(array('name' => $link != NULL ? $link : $item->getLink(FALSE), 'itemClass' => $itemClass, 'numClasses' => $item->getNumClasses(), 'numTestedClasses' => $item->getNumTestedClasses(), 'testedClassesPercent' => $item->getTestedClassesPercent(), 'numMethods' => $item->getNumMethods(), 'numTestedMethods' => $item->getNumTestedMethods(), 'testedMethodsPercent' => $item->getTestedMethodsPercent(), 'numExecutableLines' => $item->getNumExecutableLines(), 'numExecutedLines' => $item->getNumExecutedLines(), 'executedLinesPercent' => $item->getLineExecutedPercent(), 'crap' => $link == 'Total' ? '<acronym title="Change Risk Anti-Patterns (CRAP) Index">CRAP</acronym>' : ''), $lowUpperBound, $highLowerBound);
 }
Example #2
0
 /**
  * Constructor.
  *
  * @param  string                            $name
  * @param  PHP_CodeCoverage_Report_HTML_Node $parent
  * @param  array                             $executedLines
  * @param  boolean                           $yui
  * @param  boolean                           $highlight
  * @throws RuntimeException
  */
 public function __construct($name, PHP_CodeCoverage_Report_HTML_Node $parent, array $executedLines, $yui = TRUE, $highlight = FALSE)
 {
     parent::__construct($name, $parent);
     $path = $this->getPath();
     if (!file_exists($path)) {
         throw new RuntimeException(sprintf('Path "%s" does not exist.', $path));
     }
     $this->executedLines = $executedLines;
     $this->highlight = $highlight;
     $this->yui = $yui;
     $this->codeLines = $this->loadFile($path);
     $this->ignoredLines = PHP_CodeCoverage_Util::getLinesToBeIgnored($path);
     $this->calculateStatistics();
 }
Example #3
0
 /**
  * Constructor.
  *
  * @param  string                            $name
  * @param  PHP_CodeCoverage_Report_HTML_Node $parent
  * @param  array                             $coverageData
  * @param  array                             $testData
  * @param  boolean                           $cacheTokens
  * @param  boolean                           $yui
  * @param  boolean                           $highlight
  * @throws PHP_CodeCoverage_Exception
  */
 public function __construct($name, PHP_CodeCoverage_Report_HTML_Node $parent, array $coverageData, array $testData, $cacheTokens, $yui, $highlight)
 {
     parent::__construct($name, $parent);
     $path = $this->getPath();
     if (!file_exists($path)) {
         throw new PHP_CodeCoverage_Exception(sprintf('Path "%s" does not exist.', $path));
     }
     $this->coverageData = $coverageData;
     $this->testData = $testData;
     $this->cacheTokens = $cacheTokens;
     $this->highlight = $highlight;
     $this->yui = $yui;
     $this->codeLines = $this->loadFile($path);
     $this->ignoredLines = PHP_CodeCoverage_Util::getLinesToBeIgnored($path, $cacheTokens);
     $this->calculateStatistics();
 }