PEAR2_Pyrus_Developer › PEAR2_Pyrus_Developer-0.4.0/www/pear2.php.net/PEAR2_Pyrus_Developer/CoverageAnalyzer/templates/SourceFile.tpl.php
- PEAR2_Pyrus_Developer-0.4.0/
- customcommand/
- pear2.php.net/
- PEAR2_Pyrus_Developer/
- pear2.php.net/
- data/
- pear2.php.net/
- PEAR2_Pyrus_Developer/
- pear2.php.net/
- php/
- PEAR2/
- Autoload.php
- Exception.php
- MultiErrors/
- MultiErrors.php
- Pyrus/
- Developer/
- CoverageAnalyzer/
- Creator/
- PackageFile/
- Runphpt/
- Developer/
- PEAR2/
- www/
- pear2.php.net/
- PEAR2_Pyrus_Developer/
- pear2.php.net/
- customcommand/
- package.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
$info = $context->coverageInfo();
$sourceCode = $context->source();
$total = count($sourceCode);
?>
<h2>Code Coverage for <?php echo $context->shortName(); ?></h2>
<h3>Coverage: <?php echo $context->coveragePercentage(); ?>% (Covered lines / Executable lines)</h3>
<p><strong><?php echo $total; ?></strong> total lines, of which <strong><?php echo $info[1]; ?></strong> are executable, <strong><?php echo $info[2]; ?></strong> are dead and <strong><?php echo ($total - $info[2] - $info[1]); ?></strong> are non-executable lines</p>
<p>Of those <strong><?php echo $info[1]; ?></strong> executable lines there are <strong><?php echo $info[0]; ?></strong> lines covered with tests and <strong><?php echo ($info[1] - $info[0]); ?></strong> lack coverage</p>
<p><a href="<?php echo $parent->context->getRootLink(); ?>">Aggregate Code Coverage for all tests</a></p>
<pre>
<?php foreach ($context->source() as $num => $line):
$coverage = $context->coverage($num);
echo '<span class="ln">';
echo str_pad($num, 8, ' ', STR_PAD_LEFT);
echo '</span>';
if ($coverage === false) {
echo (str_pad(': ', 13, ' ', STR_PAD_LEFT) . htmlentities($line));
continue;
}
echo '<span ';
$cov = is_array($coverage) ? $coverage['coverage'] : $coverage;
if ($cov === -2) {
echo 'class="dead">';
echo ' ';
} elseif ($cov < 1) {
echo 'class="nc">';
echo ' ';
} else {
echo 'class="cv">';
if (!isset($context->coverage)) {
echo '<a href="'.$parent->context->getFileLink($context->name(), null, $num).'">';
}
$text = is_string($coverage) ? $coverage : $coverage['link'];
echo str_pad($text, 10, ' ', STR_PAD_LEFT) . ' ';
if (!isset($context->coverage)) {
echo '</a>';
}
}
echo ': ' . htmlentities($line);
echo '</span>';
endforeach; ?>
</pre>EOF
