Vendor lock

This commit is contained in:
2023-06-16 02:08:47 +00:00
parent 7933e70e90
commit 3351b92dd6
4099 changed files with 345789 additions and 0 deletions

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="%i">
<project timestamp="%i" name="BankAccount">
<file name="%s%eBankAccount.php">
<class name="BankAccount" namespace="global">
<metrics complexity="5" methods="4" coveredmethods="3" conditionals="0" coveredconditionals="0" statements="10" coveredstatements="5" elements="14" coveredelements="8"/>
</class>
<line num="6" type="method" name="getBalance" visibility="public" complexity="1" crap="1" count="2"/>
<line num="8" type="stmt" count="2"/>
<line num="11" type="method" name="setBalance" visibility="protected" complexity="2" crap="6" count="0"/>
<line num="13" type="stmt" count="0"/>
<line num="14" type="stmt" count="0"/>
<line num="15" type="stmt" count="0"/>
<line num="16" type="stmt" count="0"/>
<line num="18" type="stmt" count="0"/>
<line num="20" type="method" name="depositMoney" visibility="public" complexity="1" crap="1" count="2"/>
<line num="22" type="stmt" count="2"/>
<line num="24" type="stmt" count="1"/>
<line num="27" type="method" name="withdrawMoney" visibility="public" complexity="1" crap="1" count="2"/>
<line num="29" type="stmt" count="2"/>
<line num="31" type="stmt" count="1"/>
<metrics loc="33" ncloc="33" classes="1" methods="4" coveredmethods="3" conditionals="0" coveredconditionals="0" statements="10" coveredstatements="5" elements="14" coveredelements="8"/>
</file>
<metrics files="1" loc="33" ncloc="33" classes="1" methods="4" coveredmethods="3" conditionals="0" coveredconditionals="0" statements="10" coveredstatements="5" elements="14" coveredelements="8"/>
</project>
</coverage>

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<crap_result>
<project>BankAccount</project>
<timestamp>%s</timestamp>
<stats>
<name>Method Crap Stats</name>
<methodCount>4</methodCount>
<crapMethodCount>0</crapMethodCount>
<crapLoad>0</crapLoad>
<totalCrap>9</totalCrap>
<crapMethodPercent>0</crapMethodPercent>
</stats>
<methods>
<method>
<package>global</package>
<className>BankAccount</className>
<methodName>getBalance</methodName>
<methodSignature>getBalance()</methodSignature>
<fullMethod>getBalance()</fullMethod>
<crap>1</crap>
<complexity>1</complexity>
<coverage>100</coverage>
<crapLoad>0</crapLoad>
</method>
<method>
<package>global</package>
<className>BankAccount</className>
<methodName>setBalance</methodName>
<methodSignature>setBalance($balance)</methodSignature>
<fullMethod>setBalance($balance)</fullMethod>
<crap>6</crap>
<complexity>2</complexity>
<coverage>0</coverage>
<crapLoad>0</crapLoad>
</method>
<method>
<package>global</package>
<className>BankAccount</className>
<methodName>depositMoney</methodName>
<methodSignature>depositMoney($balance)</methodSignature>
<fullMethod>depositMoney($balance)</fullMethod>
<crap>1</crap>
<complexity>1</complexity>
<coverage>100</coverage>
<crapLoad>0</crapLoad>
</method>
<method>
<package>global</package>
<className>BankAccount</className>
<methodName>withdrawMoney</methodName>
<methodSignature>withdrawMoney($balance)</methodSignature>
<fullMethod>withdrawMoney($balance)</fullMethod>
<crap>1</crap>
<complexity>1</complexity>
<coverage>100</coverage>
<crapLoad>0</crapLoad>
</method>
</methods>
</crap_result>

View File

@ -0,0 +1,12 @@
Code Coverage Report:
%s
Summary:
Classes: 0.00% (0/1)
Methods: 75.00% (3/4)
Lines: 50.00% (5/10)
BankAccount
Methods: 75.00% ( 3/ 4) Lines: 50.00% ( 5/ 10)

View File

@ -0,0 +1,33 @@
<?php
class BankAccount
{
protected $balance = 0;
public function getBalance()
{
return $this->balance;
}
protected function setBalance($balance)
{
if ($balance >= 0) {
$this->balance = $balance;
} else {
throw new RuntimeException;
}
}
public function depositMoney($balance)
{
$this->setBalance($this->getBalance() + $balance);
return $this->getBalance();
}
public function withdrawMoney($balance)
{
$this->setBalance($this->getBalance() - $balance);
return $this->getBalance();
}
}

View File

@ -0,0 +1,66 @@
<?php
use PHPUnit\Framework\TestCase;
class BankAccountTest extends TestCase
{
protected $ba;
protected function setUp(): void
{
$this->ba = new BankAccount;
}
/**
* @covers BankAccount::getBalance
*/
public function testBalanceIsInitiallyZero()
{
$this->assertEquals(0, $this->ba->getBalance());
}
/**
* @covers BankAccount::withdrawMoney
*/
public function testBalanceCannotBecomeNegative()
{
try {
$this->ba->withdrawMoney(1);
} catch (RuntimeException $e) {
$this->assertEquals(0, $this->ba->getBalance());
return;
}
$this->fail();
}
/**
* @covers BankAccount::depositMoney
*/
public function testBalanceCannotBecomeNegative2()
{
try {
$this->ba->depositMoney(-1);
} catch (RuntimeException $e) {
$this->assertEquals(0, $this->ba->getBalance());
return;
}
$this->fail();
}
/**
* @covers BankAccount::getBalance
* @covers BankAccount::depositMoney
* @covers BankAccount::withdrawMoney
*/
public function testDepositWithdrawMoney()
{
$this->assertEquals(0, $this->ba->getBalance());
$this->ba->depositMoney(1);
$this->assertEquals(1, $this->ba->getBalance());
$this->ba->withdrawMoney(1);
$this->assertEquals(0, $this->ba->getBalance());
}
}

View File

@ -0,0 +1,14 @@
<?php
use PHPUnit\Framework\TestCase;
class CoverageClassExtendedTest extends TestCase
{
/**
* @covers CoveredClass<extended>
*/
public function testSomething()
{
$o = new CoveredClass;
$o->publicMethod();
}
}

View File

@ -0,0 +1,14 @@
<?php
use PHPUnit\Framework\TestCase;
class CoverageClassTest extends TestCase
{
/**
* @covers CoveredClass
*/
public function testSomething()
{
$o = new CoveredClass;
$o->publicMethod();
}
}

View File

@ -0,0 +1,13 @@
<?php
use PHPUnit\Framework\TestCase;
class CoverageFunctionParenthesesTest extends TestCase
{
/**
* @covers ::globalFunction()
*/
public function testSomething()
{
globalFunction();
}
}

View File

@ -0,0 +1,13 @@
<?php
use PHPUnit\Framework\TestCase;
class CoverageFunctionParenthesesWhitespaceTest extends TestCase
{
/**
* @covers ::globalFunction ( )
*/
public function testSomething()
{
globalFunction();
}
}

View File

@ -0,0 +1,13 @@
<?php
use PHPUnit\Framework\TestCase;
class CoverageFunctionTest extends TestCase
{
/**
* @covers ::globalFunction
*/
public function testSomething()
{
globalFunction();
}
}

View File

@ -0,0 +1,12 @@
<?php
use PHPUnit\Framework\TestCase;
class CoverageMethodOneLineAnnotationTest extends TestCase
{
/** @covers CoveredClass::publicMethod */
public function testSomething()
{
$o = new CoveredClass;
$o->publicMethod();
}
}

View File

@ -0,0 +1,14 @@
<?php
use PHPUnit\Framework\TestCase;
class CoverageMethodParenthesesTest extends TestCase
{
/**
* @covers CoveredClass::publicMethod()
*/
public function testSomething()
{
$o = new CoveredClass;
$o->publicMethod();
}
}

View File

@ -0,0 +1,14 @@
<?php
use PHPUnit\Framework\TestCase;
class CoverageMethodParenthesesWhitespaceTest extends TestCase
{
/**
* @covers CoveredClass::publicMethod ( )
*/
public function testSomething()
{
$o = new CoveredClass;
$o->publicMethod();
}
}

View File

@ -0,0 +1,14 @@
<?php
use PHPUnit\Framework\TestCase;
class CoverageMethodTest extends TestCase
{
/**
* @covers CoveredClass::publicMethod
*/
public function testSomething()
{
$o = new CoveredClass;
$o->publicMethod();
}
}

View File

@ -0,0 +1,11 @@
<?php
use PHPUnit\Framework\TestCase;
class CoverageNoneTest extends TestCase
{
public function testSomething()
{
$o = new CoveredClass;
$o->publicMethod();
}
}

View File

@ -0,0 +1,14 @@
<?php
use PHPUnit\Framework\TestCase;
class CoverageNotPrivateTest extends TestCase
{
/**
* @covers CoveredClass::<!private>
*/
public function testSomething()
{
$o = new CoveredClass;
$o->publicMethod();
}
}

View File

@ -0,0 +1,14 @@
<?php
use PHPUnit\Framework\TestCase;
class CoverageNotProtectedTest extends TestCase
{
/**
* @covers CoveredClass::<!protected>
*/
public function testSomething()
{
$o = new CoveredClass;
$o->publicMethod();
}
}

View File

@ -0,0 +1,14 @@
<?php
use PHPUnit\Framework\TestCase;
class CoverageNotPublicTest extends TestCase
{
/**
* @covers CoveredClass::<!public>
*/
public function testSomething()
{
$o = new CoveredClass;
$o->publicMethod();
}
}

View File

@ -0,0 +1,15 @@
<?php
use PHPUnit\Framework\TestCase;
class CoverageNothingTest extends TestCase
{
/**
* @covers CoveredClass::publicMethod
* @coversNothing
*/
public function testSomething()
{
$o = new CoveredClass;
$o->publicMethod();
}
}

View File

@ -0,0 +1,14 @@
<?php
use PHPUnit\Framework\TestCase;
class CoveragePrivateTest extends TestCase
{
/**
* @covers CoveredClass::<private>
*/
public function testSomething()
{
$o = new CoveredClass;
$o->publicMethod();
}
}

View File

@ -0,0 +1,14 @@
<?php
use PHPUnit\Framework\TestCase;
class CoverageProtectedTest extends TestCase
{
/**
* @covers CoveredClass::<protected>
*/
public function testSomething()
{
$o = new CoveredClass;
$o->publicMethod();
}
}

View File

@ -0,0 +1,14 @@
<?php
use PHPUnit\Framework\TestCase;
class CoveragePublicTest extends TestCase
{
/**
* @covers CoveredClass::<public>
*/
public function testSomething()
{
$o = new CoveredClass;
$o->publicMethod();
}
}

View File

@ -0,0 +1,17 @@
<?php
/**
* @coversDefaultClass \NamespaceOne
* @coversDefaultClass \AnotherDefault\Name\Space\Does\Not\Work
*/
class CoverageTwoDefaultClassAnnotations
{
/**
* @covers Foo\CoveredClass::<public>
*/
public function testSomething()
{
$o = new Foo\CoveredClass;
$o->publicMethod();
}
}

View File

@ -0,0 +1,36 @@
<?php
class CoveredParentClass
{
private function privateMethod()
{
}
protected function protectedMethod()
{
$this->privateMethod();
}
public function publicMethod()
{
$this->protectedMethod();
}
}
class CoveredClass extends CoveredParentClass
{
private function privateMethod()
{
}
protected function protectedMethod()
{
parent::protectedMethod();
$this->privateMethod();
}
public function publicMethod()
{
parent::publicMethod();
$this->protectedMethod();
}
}

View File

@ -0,0 +1,4 @@
<?php
function globalFunction()
{
}

View File

@ -0,0 +1,2 @@
<?php
class {CLASS}

View File

@ -0,0 +1,14 @@
<?php
use PHPUnit\Framework\TestCase;
class NamespaceCoverageClassExtendedTest extends TestCase
{
/**
* @covers Foo\CoveredClass<extended>
*/
public function testSomething()
{
$o = new Foo\CoveredClass;
$o->publicMethod();
}
}

View File

@ -0,0 +1,14 @@
<?php
use PHPUnit\Framework\TestCase;
class NamespaceCoverageClassTest extends TestCase
{
/**
* @covers Foo\CoveredClass
*/
public function testSomething()
{
$o = new Foo\CoveredClass;
$o->publicMethod();
}
}

View File

@ -0,0 +1,17 @@
<?php
use PHPUnit\Framework\TestCase;
/**
* @coversDefaultClass \Foo\CoveredClass
*/
class NamespaceCoverageCoversClassPublicTest extends TestCase
{
/**
* @covers ::publicMethod
*/
public function testSomething()
{
$o = new Foo\CoveredClass;
$o->publicMethod();
}
}

View File

@ -0,0 +1,22 @@
<?php
use PHPUnit\Framework\TestCase;
/**
* @coversDefaultClass \Foo\CoveredClass
*/
class NamespaceCoverageCoversClassTest extends TestCase
{
/**
* @covers ::privateMethod
* @covers ::protectedMethod
* @covers ::publicMethod
* @covers \Foo\CoveredParentClass::privateMethod
* @covers \Foo\CoveredParentClass::protectedMethod
* @covers \Foo\CoveredParentClass::publicMethod
*/
public function testSomething()
{
$o = new Foo\CoveredClass;
$o->publicMethod();
}
}

View File

@ -0,0 +1,14 @@
<?php
use PHPUnit\Framework\TestCase;
class NamespaceCoverageMethodTest extends TestCase
{
/**
* @covers Foo\CoveredClass::publicMethod
*/
public function testSomething()
{
$o = new Foo\CoveredClass;
$o->publicMethod();
}
}

View File

@ -0,0 +1,14 @@
<?php
use PHPUnit\Framework\TestCase;
class NamespaceCoverageNotPrivateTest extends TestCase
{
/**
* @covers Foo\CoveredClass::<!private>
*/
public function testSomething()
{
$o = new Foo\CoveredClass;
$o->publicMethod();
}
}

View File

@ -0,0 +1,14 @@
<?php
use PHPUnit\Framework\TestCase;
class NamespaceCoverageNotProtectedTest extends TestCase
{
/**
* @covers Foo\CoveredClass::<!protected>
*/
public function testSomething()
{
$o = new Foo\CoveredClass;
$o->publicMethod();
}
}

View File

@ -0,0 +1,14 @@
<?php
use PHPUnit\Framework\TestCase;
class NamespaceCoverageNotPublicTest extends TestCase
{
/**
* @covers Foo\CoveredClass::<!public>
*/
public function testSomething()
{
$o = new Foo\CoveredClass;
$o->publicMethod();
}
}

View File

@ -0,0 +1,14 @@
<?php
use PHPUnit\Framework\TestCase;
class NamespaceCoveragePrivateTest extends TestCase
{
/**
* @covers Foo\CoveredClass::<private>
*/
public function testSomething()
{
$o = new Foo\CoveredClass;
$o->publicMethod();
}
}

View File

@ -0,0 +1,14 @@
<?php
use PHPUnit\Framework\TestCase;
class NamespaceCoverageProtectedTest extends TestCase
{
/**
* @covers Foo\CoveredClass::<protected>
*/
public function testSomething()
{
$o = new Foo\CoveredClass;
$o->publicMethod();
}
}

View File

@ -0,0 +1,14 @@
<?php
use PHPUnit\Framework\TestCase;
class NamespaceCoveragePublicTest extends TestCase
{
/**
* @covers Foo\CoveredClass::<public>
*/
public function testSomething()
{
$o = new Foo\CoveredClass;
$o->publicMethod();
}
}

View File

@ -0,0 +1,38 @@
<?php
namespace Foo;
class CoveredParentClass
{
private function privateMethod()
{
}
protected function protectedMethod()
{
$this->privateMethod();
}
public function publicMethod()
{
$this->protectedMethod();
}
}
class CoveredClass extends CoveredParentClass
{
private function privateMethod()
{
}
protected function protectedMethod()
{
parent::protectedMethod();
$this->privateMethod();
}
public function publicMethod()
{
parent::publicMethod();
$this->protectedMethod();
}
}

View File

@ -0,0 +1,26 @@
<?php
use PHPUnit\Framework\TestCase;
class NotExistingCoveredElementTest extends TestCase
{
/**
* @covers NotExistingClass
*/
public function testOne()
{
}
/**
* @covers NotExistingClass::notExistingMethod
*/
public function testTwo()
{
}
/**
* @covers NotExistingClass::<public>
*/
public function testThree()
{
}
}

View File

@ -0,0 +1,249 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Code Coverage for %s%eBankAccount.php</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="_css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="_css/octicons.css" rel="stylesheet" type="text/css">
<link href="_css/style.css" rel="stylesheet" type="text/css">
<link href="_css/custom.css" rel="stylesheet" type="text/css">
</head>
<body>
<header>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.html">%s</a></li>
<li class="breadcrumb-item active">BankAccount.php</li>
</ol>
</nav>
</div>
</div>
</div>
</header>
<div class="container-fluid">
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<td>&nbsp;</td>
<td colspan="10"><div align="center"><strong>Code Coverage</strong></div></td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="3"><div align="center"><strong>Classes and Traits</strong></div></td>
<td colspan="4"><div align="center"><strong>Functions and Methods</strong></div></td>
<td colspan="3"><div align="center"><strong>Lines</strong></div></td>
</tr>
</thead>
<tbody>
<tr>
<td class="danger">Total</td>
<td class="danger big"> <div class="progress">
<div class="progress-bar bg-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
<span class="sr-only">0.00% covered (danger)</span>
</div>
</div>
</td>
<td class="danger small"><div align="right">0.00%</div></td>
<td class="danger small"><div align="right">0&nbsp;/&nbsp;1</div></td>
<td class="warning big"> <div class="progress">
<div class="progress-bar bg-warning" role="progressbar" aria-valuenow="75.00" aria-valuemin="0" aria-valuemax="100" style="width: 75.00%">
<span class="sr-only">75.00% covered (warning)</span>
</div>
</div>
</td>
<td class="warning small"><div align="right">75.00%</div></td>
<td class="warning small"><div align="right">3&nbsp;/&nbsp;4</div></td>
<td class="warning small"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></td>
<td class="danger big"> <div class="progress">
<div class="progress-bar bg-danger" role="progressbar" aria-valuenow="50.00" aria-valuemin="0" aria-valuemax="100" style="width: 50.00%">
<span class="sr-only">50.00% covered (danger)</span>
</div>
</div>
</td>
<td class="danger small"><div align="right">50.00%</div></td>
<td class="danger small"><div align="right">5&nbsp;/&nbsp;10</div></td>
</tr>
<tr>
<td class="danger">BankAccount</td>
<td class="danger big"> <div class="progress">
<div class="progress-bar bg-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
<span class="sr-only">0.00% covered (danger)</span>
</div>
</div>
</td>
<td class="danger small"><div align="right">0.00%</div></td>
<td class="danger small"><div align="right">0&nbsp;/&nbsp;1</div></td>
<td class="warning big"> <div class="progress">
<div class="progress-bar bg-warning" role="progressbar" aria-valuenow="75.00" aria-valuemin="0" aria-valuemax="100" style="width: 75.00%">
<span class="sr-only">75.00% covered (warning)</span>
</div>
</div>
</td>
<td class="warning small"><div align="right">75.00%</div></td>
<td class="warning small"><div align="right">3&nbsp;/&nbsp;4</div></td>
<td class="warning small">8.12</td>
<td class="danger big"> <div class="progress">
<div class="progress-bar bg-danger" role="progressbar" aria-valuenow="50.00" aria-valuemin="0" aria-valuemax="100" style="width: 50.00%">
<span class="sr-only">50.00% covered (danger)</span>
</div>
</div>
</td>
<td class="danger small"><div align="right">50.00%</div></td>
<td class="danger small"><div align="right">5&nbsp;/&nbsp;10</div></td>
</tr>
<tr>
<td class="success" colspan="4">&nbsp;<a href="#6"><abbr title="getBalance()">getBalance</abbr></a></td>
<td class="success big"> <div class="progress">
<div class="progress-bar bg-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
<span class="sr-only">100.00% covered (success)</span>
</div>
</div>
</td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">1&nbsp;/&nbsp;1</div></td>
<td class="success small">1</td>
<td class="success big"> <div class="progress">
<div class="progress-bar bg-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
<span class="sr-only">100.00% covered (success)</span>
</div>
</div>
</td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">1&nbsp;/&nbsp;1</div></td>
</tr>
<tr>
<td class="danger" colspan="4">&nbsp;<a href="#11"><abbr title="setBalance($balance)">setBalance</abbr></a></td>
<td class="danger big"> <div class="progress">
<div class="progress-bar bg-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
<span class="sr-only">0.00% covered (danger)</span>
</div>
</div>
</td>
<td class="danger small"><div align="right">0.00%</div></td>
<td class="danger small"><div align="right">0&nbsp;/&nbsp;1</div></td>
<td class="danger small">6</td>
<td class="danger big"> <div class="progress">
<div class="progress-bar bg-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
<span class="sr-only">0.00% covered (danger)</span>
</div>
</div>
</td>
<td class="danger small"><div align="right">0.00%</div></td>
<td class="danger small"><div align="right">0&nbsp;/&nbsp;5</div></td>
</tr>
<tr>
<td class="success" colspan="4">&nbsp;<a href="#20"><abbr title="depositMoney($balance)">depositMoney</abbr></a></td>
<td class="success big"> <div class="progress">
<div class="progress-bar bg-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
<span class="sr-only">100.00% covered (success)</span>
</div>
</div>
</td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">1&nbsp;/&nbsp;1</div></td>
<td class="success small">1</td>
<td class="success big"> <div class="progress">
<div class="progress-bar bg-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
<span class="sr-only">100.00% covered (success)</span>
</div>
</div>
</td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">2&nbsp;/&nbsp;2</div></td>
</tr>
<tr>
<td class="success" colspan="4">&nbsp;<a href="#27"><abbr title="withdrawMoney($balance)">withdrawMoney</abbr></a></td>
<td class="success big"> <div class="progress">
<div class="progress-bar bg-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
<span class="sr-only">100.00% covered (success)</span>
</div>
</div>
</td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">1&nbsp;/&nbsp;1</div></td>
<td class="success small">1</td>
<td class="success big"> <div class="progress">
<div class="progress-bar bg-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
<span class="sr-only">100.00% covered (success)</span>
</div>
</div>
</td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">2&nbsp;/&nbsp;2</div></td>
</tr>
</tbody>
</table>
</div>
<table id="code" class="table table-borderless table-condensed">
<tbody>
<tr><td><div align="right"><a name="1"></a><a href="#1">1</a></div></td><td class="codeLine"><span class="default">&lt;?php</span></td></tr>
<tr><td><div align="right"><a name="2"></a><a href="#2">2</a></div></td><td class="codeLine"><span class="keyword">class</span><span class="default">&nbsp;</span><span class="default">BankAccount</span></td></tr>
<tr><td><div align="right"><a name="3"></a><a href="#3">3</a></div></td><td class="codeLine"><span class="keyword">{</span></td></tr>
<tr><td><div align="right"><a name="4"></a><a href="#4">4</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">protected</span><span class="default">&nbsp;</span><span class="default">$balance</span><span class="default">&nbsp;</span><span class="keyword">=</span><span class="default">&nbsp;</span><span class="default">0</span><span class="keyword">;</span></td></tr>
<tr><td><div align="right"><a name="5"></a><a href="#5">5</a></div></td><td class="codeLine"></td></tr>
<tr><td><div align="right"><a name="6"></a><a href="#6">6</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">public</span><span class="default">&nbsp;</span><span class="keyword">function</span><span class="default">&nbsp;</span><span class="default">getBalance</span><span class="keyword">(</span><span class="keyword">)</span></td></tr>
<tr><td><div align="right"><a name="7"></a><a href="#7">7</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">{</span></td></tr>
<tr class="covered-by-large-tests popin"><td data-title="2 tests cover line 8" data-content="&lt;ul&gt;&lt;li&gt;BankAccountTest::testBalanceIsInitiallyZero&lt;/li&gt;&lt;li&gt;BankAccountTest::testDepositWithdrawMoney&lt;/li&gt;&lt;/ul&gt;" data-placement="top" data-html="true"><div align="right"><a name="8"></a><a href="#8">8</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">return</span><span class="default">&nbsp;</span><span class="default">$this</span><span class="default">-&gt;</span><span class="default">balance</span><span class="keyword">;</span></td></tr>
<tr class="warning"><td><div align="right"><a name="9"></a><a href="#9">9</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">}</span></td></tr>
<tr><td><div align="right"><a name="10"></a><a href="#10">10</a></div></td><td class="codeLine"></td></tr>
<tr><td><div align="right"><a name="11"></a><a href="#11">11</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">protected</span><span class="default">&nbsp;</span><span class="keyword">function</span><span class="default">&nbsp;</span><span class="default">setBalance</span><span class="keyword">(</span><span class="default">$balance</span><span class="keyword">)</span></td></tr>
<tr><td><div align="right"><a name="12"></a><a href="#12">12</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">{</span></td></tr>
<tr class="danger"><td><div align="right"><a name="13"></a><a href="#13">13</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">if</span><span class="default">&nbsp;</span><span class="keyword">(</span><span class="default">$balance</span><span class="default">&nbsp;</span><span class="default">&gt;=</span><span class="default">&nbsp;</span><span class="default">0</span><span class="keyword">)</span><span class="default">&nbsp;</span><span class="keyword">{</span></td></tr>
<tr class="danger"><td><div align="right"><a name="14"></a><a href="#14">14</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$this</span><span class="default">-&gt;</span><span class="default">balance</span><span class="default">&nbsp;</span><span class="keyword">=</span><span class="default">&nbsp;</span><span class="default">$balance</span><span class="keyword">;</span></td></tr>
<tr class="danger"><td><div align="right"><a name="15"></a><a href="#15">15</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">}</span><span class="default">&nbsp;</span><span class="keyword">else</span><span class="default">&nbsp;</span><span class="keyword">{</span></td></tr>
<tr class="danger"><td><div align="right"><a name="16"></a><a href="#16">16</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">throw</span><span class="default">&nbsp;</span><span class="keyword">new</span><span class="default">&nbsp;</span><span class="default">RuntimeException</span><span class="keyword">;</span></td></tr>
<tr><td><div align="right"><a name="17"></a><a href="#17">17</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">}</span></td></tr>
<tr class="danger"><td><div align="right"><a name="18"></a><a href="#18">18</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">}</span></td></tr>
<tr><td><div align="right"><a name="19"></a><a href="#19">19</a></div></td><td class="codeLine"></td></tr>
<tr><td><div align="right"><a name="20"></a><a href="#20">20</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">public</span><span class="default">&nbsp;</span><span class="keyword">function</span><span class="default">&nbsp;</span><span class="default">depositMoney</span><span class="keyword">(</span><span class="default">$balance</span><span class="keyword">)</span></td></tr>
<tr><td><div align="right"><a name="21"></a><a href="#21">21</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">{</span></td></tr>
<tr class="covered-by-large-tests popin"><td data-title="2 tests cover line 22" data-content="&lt;ul&gt;&lt;li&gt;BankAccountTest::testBalanceCannotBecomeNegative2&lt;/li&gt;&lt;li&gt;BankAccountTest::testDepositWithdrawMoney&lt;/li&gt;&lt;/ul&gt;" data-placement="top" data-html="true"><div align="right"><a name="22"></a><a href="#22">22</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$this</span><span class="default">-&gt;</span><span class="default">setBalance</span><span class="keyword">(</span><span class="default">$this</span><span class="default">-&gt;</span><span class="default">getBalance</span><span class="keyword">(</span><span class="keyword">)</span><span class="default">&nbsp;</span><span class="keyword">+</span><span class="default">&nbsp;</span><span class="default">$balance</span><span class="keyword">)</span><span class="keyword">;</span></td></tr>
<tr><td><div align="right"><a name="23"></a><a href="#23">23</a></div></td><td class="codeLine"></td></tr>
<tr class="covered-by-large-tests popin"><td data-title="1 test covers line 24" data-content="&lt;ul&gt;&lt;li&gt;BankAccountTest::testDepositWithdrawMoney&lt;/li&gt;&lt;/ul&gt;" data-placement="top" data-html="true"><div align="right"><a name="24"></a><a href="#24">24</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">return</span><span class="default">&nbsp;</span><span class="default">$this</span><span class="default">-&gt;</span><span class="default">getBalance</span><span class="keyword">(</span><span class="keyword">)</span><span class="keyword">;</span></td></tr>
<tr class="warning"><td><div align="right"><a name="25"></a><a href="#25">25</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">}</span></td></tr>
<tr><td><div align="right"><a name="26"></a><a href="#26">26</a></div></td><td class="codeLine"></td></tr>
<tr><td><div align="right"><a name="27"></a><a href="#27">27</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">public</span><span class="default">&nbsp;</span><span class="keyword">function</span><span class="default">&nbsp;</span><span class="default">withdrawMoney</span><span class="keyword">(</span><span class="default">$balance</span><span class="keyword">)</span></td></tr>
<tr><td><div align="right"><a name="28"></a><a href="#28">28</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">{</span></td></tr>
<tr class="covered-by-large-tests popin"><td data-title="2 tests cover line 29" data-content="&lt;ul&gt;&lt;li&gt;BankAccountTest::testBalanceCannotBecomeNegative&lt;/li&gt;&lt;li&gt;BankAccountTest::testDepositWithdrawMoney&lt;/li&gt;&lt;/ul&gt;" data-placement="top" data-html="true"><div align="right"><a name="29"></a><a href="#29">29</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$this</span><span class="default">-&gt;</span><span class="default">setBalance</span><span class="keyword">(</span><span class="default">$this</span><span class="default">-&gt;</span><span class="default">getBalance</span><span class="keyword">(</span><span class="keyword">)</span><span class="default">&nbsp;</span><span class="keyword">-</span><span class="default">&nbsp;</span><span class="default">$balance</span><span class="keyword">)</span><span class="keyword">;</span></td></tr>
<tr><td><div align="right"><a name="30"></a><a href="#30">30</a></div></td><td class="codeLine"></td></tr>
<tr class="covered-by-large-tests popin"><td data-title="1 test covers line 31" data-content="&lt;ul&gt;&lt;li&gt;BankAccountTest::testDepositWithdrawMoney&lt;/li&gt;&lt;/ul&gt;" data-placement="top" data-html="true"><div align="right"><a name="31"></a><a href="#31">31</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">return</span><span class="default">&nbsp;</span><span class="default">$this</span><span class="default">-&gt;</span><span class="default">getBalance</span><span class="keyword">(</span><span class="keyword">)</span><span class="keyword">;</span></td></tr>
<tr class="warning"><td><div align="right"><a name="32"></a><a href="#32">32</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">}</span></td></tr>
<tr><td><div align="right"><a name="33"></a><a href="#33">33</a></div></td><td class="codeLine"><span class="keyword">}</span></td></tr>
</tbody>
</table>
<footer>
<hr/>
<h4>Legend</h4>
<p>
<span class="success"><strong>Executed</strong></span>
<span class="danger"><strong>Not Executed</strong></span>
<span class="warning"><strong>Dead Code</strong></span>
</p>
<p>
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage %s</a> using <a href="%s" target="_top">%s</a> at %s.</small>
</p>
<a title="Back to the top" id="toplink" href="#">
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="16" viewBox="0 0 12 16"><path fill-rule="evenodd" d="M12 11L6 5l-6 6h12z"/></svg>
</a>
</footer>
</div>
<script src="_js/jquery.min.js" type="text/javascript"></script>
<script src="_js/popper.min.js" type="text/javascript"></script>
<script src="_js/bootstrap.min.js" type="text/javascript"></script>
<script src="_js/file.js" type="text/javascript"></script>
</body>
</html>

View File

@ -0,0 +1,287 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Dashboard for %s</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="_css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="_css/nv.d3.min.css" rel="stylesheet" type="text/css">
<link href="_css/style.css" rel="stylesheet" type="text/css">
<link href="_css/custom.css" rel="stylesheet" type="text/css">
</head>
<body>
<header>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.html">%s</a></li>
<li class="breadcrumb-item active">(Dashboard)</li>
</ol>
</nav>
</div>
</div>
</div>
</header>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<h2>Classes</h2>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h3>Coverage Distribution</h3>
<div id="classCoverageDistribution" style="height: 300px;">
<svg></svg>
</div>
</div>
<div class="col-md-6">
<h3>Complexity</h3>
<div id="classComplexity" style="height: 300px;">
<svg></svg>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h3>Insufficient Coverage</h3>
<div class="scrollbox">
<table class="table">
<thead>
<tr>
<th>Class</th>
<th class="text-right">Coverage</th>
</tr>
</thead>
<tbody>
<tr><td><a href="BankAccount.php.html#2">BankAccount</a></td><td class="text-right">50%</td></tr>
</tbody>
</table>
</div>
</div>
<div class="col-md-6">
<h3>Project Risks</h3>
<div class="scrollbox">
<table class="table">
<thead>
<tr>
<th>Class</th>
<th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
</tr>
</thead>
<tbody>
<tr><td><a href="BankAccount.php.html#2">BankAccount</a></td><td class="text-right">8</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h2>Methods</h2>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h3>Coverage Distribution</h3>
<div id="methodCoverageDistribution" style="height: 300px;">
<svg></svg>
</div>
</div>
<div class="col-md-6">
<h3>Complexity</h3>
<div id="methodComplexity" style="height: 300px;">
<svg></svg>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h3>Insufficient Coverage</h3>
<div class="scrollbox">
<table class="table">
<thead>
<tr>
<th>Method</th>
<th class="text-right">Coverage</th>
</tr>
</thead>
<tbody>
<tr><td><a href="BankAccount.php.html#11"><abbr title="BankAccount::setBalance">setBalance</abbr></a></td><td class="text-right">0%</td></tr>
</tbody>
</table>
</div>
</div>
<div class="col-md-6">
<h3>Project Risks</h3>
<div class="scrollbox">
<table class="table">
<thead>
<tr>
<th>Method</th>
<th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
</tr>
</thead>
<tbody>
<tr><td><a href="BankAccount.php.html#11"><abbr title="BankAccount::setBalance">setBalance</abbr></a></td><td class="text-right">6</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<footer>
<hr/>
<p>
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage %s</a> using <a href="%s" target="_top">%s</a> at %s.</small>
</p>
</footer>
</div>
<script src="_js/jquery.min.js" type="text/javascript"></script>
<script src="_js/d3.min.js" type="text/javascript"></script>
<script src="_js/nv.d3.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
nv.addGraph(function() {
var chart = nv.models.multiBarChart();
chart.tooltips(false)
.showControls(false)
.showLegend(false)
.reduceXTicks(false)
.staggerLabels(true)
.yAxis.tickFormat(d3.format('d'));
d3.select('#classCoverageDistribution svg')
.datum(getCoverageDistributionData([0,0,0,0,0,0,1,0,0,0,0,0], "Class Coverage"))
.transition().duration(500).call(chart);
nv.utils.windowResize(chart.update);
return chart;
});
nv.addGraph(function() {
var chart = nv.models.multiBarChart();
chart.tooltips(false)
.showControls(false)
.showLegend(false)
.reduceXTicks(false)
.staggerLabels(true)
.yAxis.tickFormat(d3.format('d'));
d3.select('#methodCoverageDistribution svg')
.datum(getCoverageDistributionData([1,0,0,0,0,0,0,0,0,0,0,3], "Method Coverage"))
.transition().duration(500).call(chart);
nv.utils.windowResize(chart.update);
return chart;
});
function getCoverageDistributionData(data, label) {
var labels = [
'0%',
'0-10%',
'10-20%',
'20-30%',
'30-40%',
'40-50%',
'50-60%',
'60-70%',
'70-80%',
'80-90%',
'90-100%',
'100%'
];
var values = [];
$.each(labels, function(key) {
values.push({x: labels[key], y: data[key]});
});
return [
{
key: label,
values: values,
color: "#4572A7"
}
];
}
nv.addGraph(function() {
var chart = nv.models.scatterChart()
.showDistX(true)
.showDistY(true)
.showLegend(false)
.forceX([0, 100]);
chart.tooltipContent(function(graph) {
return '<p>' + graph.point.class + '</p>';
});
chart.xAxis.axisLabel('Code Coverage (in percent)');
chart.yAxis.axisLabel('Cyclomatic Complexity');
d3.select('#classComplexity svg')
.datum(getComplexityData([[50,5,"<a href=\"BankAccount.php.html#2\">BankAccount<\/a>"]], 'Class Complexity'))
.transition()
.duration(500)
.call(chart);
nv.utils.windowResize(chart.update);
return chart;
});
nv.addGraph(function() {
var chart = nv.models.scatterChart()
.showDistX(true)
.showDistY(true)
.showLegend(false)
.forceX([0, 100]);
chart.tooltipContent(function(graph) {
return '<p>' + graph.point.class + '</p>';
});
chart.xAxis.axisLabel('Code Coverage (in percent)');
chart.yAxis.axisLabel('Method Complexity');
d3.select('#methodComplexity svg')
.datum(getComplexityData([[100,1,"<a href=\"BankAccount.php.html#6\">BankAccount::getBalance<\/a>"],[0,2,"<a href=\"BankAccount.php.html#11\">BankAccount::setBalance<\/a>"],[100,1,"<a href=\"BankAccount.php.html#20\">BankAccount::depositMoney<\/a>"],[100,1,"<a href=\"BankAccount.php.html#27\">BankAccount::withdrawMoney<\/a>"]], 'Method Complexity'))
.transition()
.duration(500)
.call(chart);
nv.utils.windowResize(chart.update);
return chart;
});
function getComplexityData(data, label) {
var values = [];
$.each(data, function(key) {
var value = Math.round(data[key][0]*100) / 100;
values.push({
x: value,
y: data[key][1],
class: data[key][2],
size: 0.05,
shape: 'diamond'
});
});
return [
{
key: label,
values: values,
color: "#4572A7"
}
];
}
});
</script>
</body>
</html>

View File

@ -0,0 +1,118 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Code Coverage for %s</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="_css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="_css/octicons.css" rel="stylesheet" type="text/css">
<link href="_css/style.css" rel="stylesheet" type="text/css">
<link href="_css/custom.css" rel="stylesheet" type="text/css">
</head>
<body>
<header>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item active">%s</li>
<li class="breadcrumb-item">(<a href="dashboard.html">Dashboard</a>)</li>
</ol>
</nav>
</div>
</div>
</div>
</header>
<div class="container-fluid">
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<td>&nbsp;</td>
<td colspan="9"><div align="center"><strong>Code Coverage</strong></div></td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="3"><div align="center"><strong>Lines</strong></div></td>
<td colspan="3"><div align="center"><strong>Functions and Methods</strong></div></td>
<td colspan="3"><div align="center"><strong>Classes and Traits</strong></div></td>
</tr>
</thead>
<tbody>
<tr>
<td class="danger">Total</td>
<td class="danger big"> <div class="progress">
<div class="progress-bar bg-danger" role="progressbar" aria-valuenow="50.00" aria-valuemin="0" aria-valuemax="100" style="width: 50.00%">
<span class="sr-only">50.00% covered (danger)</span>
</div>
</div>
</td>
<td class="danger small"><div align="right">50.00%</div></td>
<td class="danger small"><div align="right">5&nbsp;/&nbsp;10</div></td>
<td class="warning big"> <div class="progress">
<div class="progress-bar bg-warning" role="progressbar" aria-valuenow="75.00" aria-valuemin="0" aria-valuemax="100" style="width: 75.00%">
<span class="sr-only">75.00% covered (warning)</span>
</div>
</div>
</td>
<td class="warning small"><div align="right">75.00%</div></td>
<td class="warning small"><div align="right">3&nbsp;/&nbsp;4</div></td>
<td class="danger big"> <div class="progress">
<div class="progress-bar bg-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
<span class="sr-only">0.00% covered (danger)</span>
</div>
</div>
</td>
<td class="danger small"><div align="right">0.00%</div></td>
<td class="danger small"><div align="right">0&nbsp;/&nbsp;1</div></td>
</tr>
<tr>
<td class="danger"><img src="_icons/file-code.svg" class="octicon" /><a href="BankAccount.php.html">BankAccount.php</a></td>
<td class="danger big"> <div class="progress">
<div class="progress-bar bg-danger" role="progressbar" aria-valuenow="50.00" aria-valuemin="0" aria-valuemax="100" style="width: 50.00%">
<span class="sr-only">50.00% covered (danger)</span>
</div>
</div>
</td>
<td class="danger small"><div align="right">50.00%</div></td>
<td class="danger small"><div align="right">5&nbsp;/&nbsp;10</div></td>
<td class="warning big"> <div class="progress">
<div class="progress-bar bg-warning" role="progressbar" aria-valuenow="75.00" aria-valuemin="0" aria-valuemax="100" style="width: 75.00%">
<span class="sr-only">75.00% covered (warning)</span>
</div>
</div>
</td>
<td class="warning small"><div align="right">75.00%</div></td>
<td class="warning small"><div align="right">3&nbsp;/&nbsp;4</div></td>
<td class="danger big"> <div class="progress">
<div class="progress-bar bg-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
<span class="sr-only">0.00% covered (danger)</span>
</div>
</div>
</td>
<td class="danger small"><div align="right">0.00%</div></td>
<td class="danger small"><div align="right">0&nbsp;/&nbsp;1</div></td>
</tr>
</tbody>
</table>
</div>
<footer>
<hr/>
<h4>Legend</h4>
<p>
<span class="danger"><strong>Low</strong>: 0% to 50%</span>
<span class="warning"><strong>Medium</strong>: 50% to 90%</span>
<span class="success"><strong>High</strong>: 90% to 100%</span>
</p>
<p>
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage %s</a> using <a href="%s" target="_top">%s</a> at %s.</small>
</p>
</footer>
</div>
</body>
</html>

View File

@ -0,0 +1,285 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Dashboard for %s</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="_css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="_css/nv.d3.min.css" rel="stylesheet" type="text/css">
<link href="_css/style.css" rel="stylesheet" type="text/css">
<link href="_css/custom.css" rel="stylesheet" type="text/css">
</head>
<body>
<header>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.html">%s</a></li>
<li class="breadcrumb-item active">(Dashboard)</li>
</ol>
</nav>
</div>
</div>
</div>
</header>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<h2>Classes</h2>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h3>Coverage Distribution</h3>
<div id="classCoverageDistribution" style="height: 300px;">
<svg></svg>
</div>
</div>
<div class="col-md-6">
<h3>Complexity</h3>
<div id="classComplexity" style="height: 300px;">
<svg></svg>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h3>Insufficient Coverage</h3>
<div class="scrollbox">
<table class="table">
<thead>
<tr>
<th>Class</th>
<th class="text-right">Coverage</th>
</tr>
</thead>
<tbody>
<tr><td><a href="source_with_class_and_anonymous_function.php.html#3">CoveredClassWithAnonymousFunctionInStaticMethod</a></td><td class="text-right">87%</td></tr>
</tbody>
</table>
</div>
</div>
<div class="col-md-6">
<h3>Project Risks</h3>
<div class="scrollbox">
<table class="table">
<thead>
<tr>
<th>Class</th>
<th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h2>Methods</h2>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h3>Coverage Distribution</h3>
<div id="methodCoverageDistribution" style="height: 300px;">
<svg></svg>
</div>
</div>
<div class="col-md-6">
<h3>Complexity</h3>
<div id="methodComplexity" style="height: 300px;">
<svg></svg>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h3>Insufficient Coverage</h3>
<div class="scrollbox">
<table class="table">
<thead>
<tr>
<th>Method</th>
<th class="text-right">Coverage</th>
</tr>
</thead>
<tbody>
<tr><td><a href="source_with_class_and_anonymous_function.php.html#5"><abbr title="CoveredClassWithAnonymousFunctionInStaticMethod::runAnonymous">runAnonymous</abbr></a></td><td class="text-right">87%</td></tr>
</tbody>
</table>
</div>
</div>
<div class="col-md-6">
<h3>Project Risks</h3>
<div class="scrollbox">
<table class="table">
<thead>
<tr>
<th>Method</th>
<th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<footer>
<hr/>
<p>
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage %s</a> using <a href="%s" target="_top">%s</a> at %s.</small>
</p>
</footer>
</div>
<script src="_js/jquery.min.js" type="text/javascript"></script>
<script src="_js/d3.min.js" type="text/javascript"></script>
<script src="_js/nv.d3.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
nv.addGraph(function() {
var chart = nv.models.multiBarChart();
chart.tooltips(false)
.showControls(false)
.showLegend(false)
.reduceXTicks(false)
.staggerLabels(true)
.yAxis.tickFormat(d3.format('d'));
d3.select('#classCoverageDistribution svg')
.datum(getCoverageDistributionData([0,0,0,0,0,0,0,0,0,1,0,0], "Class Coverage"))
.transition().duration(500).call(chart);
nv.utils.windowResize(chart.update);
return chart;
});
nv.addGraph(function() {
var chart = nv.models.multiBarChart();
chart.tooltips(false)
.showControls(false)
.showLegend(false)
.reduceXTicks(false)
.staggerLabels(true)
.yAxis.tickFormat(d3.format('d'));
d3.select('#methodCoverageDistribution svg')
.datum(getCoverageDistributionData([0,0,0,0,0,0,0,0,0,1,0,0], "Method Coverage"))
.transition().duration(500).call(chart);
nv.utils.windowResize(chart.update);
return chart;
});
function getCoverageDistributionData(data, label) {
var labels = [
'0%',
'0-10%',
'10-20%',
'20-30%',
'30-40%',
'40-50%',
'50-60%',
'60-70%',
'70-80%',
'80-90%',
'90-100%',
'100%'
];
var values = [];
$.each(labels, function(key) {
values.push({x: labels[key], y: data[key]});
});
return [
{
key: label,
values: values,
color: "#4572A7"
}
];
}
nv.addGraph(function() {
var chart = nv.models.scatterChart()
.showDistX(true)
.showDistY(true)
.showLegend(false)
.forceX([0, 100]);
chart.tooltipContent(function(graph) {
return '<p>' + graph.point.class + '</p>';
});
chart.xAxis.axisLabel('Code Coverage (in percent)');
chart.yAxis.axisLabel('Cyclomatic Complexity');
d3.select('#classComplexity svg')
.datum(getComplexityData([[87.5,1,"<a href=\"source_with_class_and_anonymous_function.php.html#3\">CoveredClassWithAnonymousFunctionInStaticMethod<\/a>"]], 'Class Complexity'))
.transition()
.duration(500)
.call(chart);
nv.utils.windowResize(chart.update);
return chart;
});
nv.addGraph(function() {
var chart = nv.models.scatterChart()
.showDistX(true)
.showDistY(true)
.showLegend(false)
.forceX([0, 100]);
chart.tooltipContent(function(graph) {
return '<p>' + graph.point.class + '</p>';
});
chart.xAxis.axisLabel('Code Coverage (in percent)');
chart.yAxis.axisLabel('Method Complexity');
d3.select('#methodComplexity svg')
.datum(getComplexityData([[87.5,1,"<a href=\"source_with_class_and_anonymous_function.php.html#5\">CoveredClassWithAnonymousFunctionInStaticMethod::runAnonymous<\/a>"]], 'Method Complexity'))
.transition()
.duration(500)
.call(chart);
nv.utils.windowResize(chart.update);
return chart;
});
function getComplexityData(data, label) {
var values = [];
$.each(data, function(key) {
var value = Math.round(data[key][0]*100) / 100;
values.push({
x: value,
y: data[key][1],
class: data[key][2],
size: 0.05,
shape: 'diamond'
});
});
return [
{
key: label,
values: values,
color: "#4572A7"
}
];
}
});
</script>
</body>
</html>

View File

@ -0,0 +1,118 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Code Coverage for %s</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="_css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="_css/octicons.css" rel="stylesheet" type="text/css">
<link href="_css/style.css" rel="stylesheet" type="text/css">
<link href="_css/custom.css" rel="stylesheet" type="text/css">
</head>
<body>
<header>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item active">%s</li>
<li class="breadcrumb-item">(<a href="dashboard.html">Dashboard</a>)</li>
</ol>
</nav>
</div>
</div>
</div>
</header>
<div class="container-fluid">
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<td>&nbsp;</td>
<td colspan="9"><div align="center"><strong>Code Coverage</strong></div></td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="3"><div align="center"><strong>Lines</strong></div></td>
<td colspan="3"><div align="center"><strong>Functions and Methods</strong></div></td>
<td colspan="3"><div align="center"><strong>Classes and Traits</strong></div></td>
</tr>
</thead>
<tbody>
<tr>
<td class="warning">Total</td>
<td class="warning big"> <div class="progress">
<div class="progress-bar bg-warning" role="progressbar" aria-valuenow="87.50" aria-valuemin="0" aria-valuemax="100" style="width: 87.50%">
<span class="sr-only">87.50% covered (warning)</span>
</div>
</div>
</td>
<td class="warning small"><div align="right">87.50%</div></td>
<td class="warning small"><div align="right">7&nbsp;/&nbsp;8</div></td>
<td class="danger big"> <div class="progress">
<div class="progress-bar bg-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
<span class="sr-only">0.00% covered (danger)</span>
</div>
</div>
</td>
<td class="danger small"><div align="right">0.00%</div></td>
<td class="danger small"><div align="right">0&nbsp;/&nbsp;1</div></td>
<td class="danger big"> <div class="progress">
<div class="progress-bar bg-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
<span class="sr-only">0.00% covered (danger)</span>
</div>
</div>
</td>
<td class="danger small"><div align="right">0.00%</div></td>
<td class="danger small"><div align="right">0&nbsp;/&nbsp;1</div></td>
</tr>
<tr>
<td class="warning"><img src="_icons/file-code.svg" class="octicon" /><a href="source_with_class_and_anonymous_function.php.html">source_with_class_and_anonymous_function.php</a></td>
<td class="warning big"> <div class="progress">
<div class="progress-bar bg-warning" role="progressbar" aria-valuenow="87.50" aria-valuemin="0" aria-valuemax="100" style="width: 87.50%">
<span class="sr-only">87.50% covered (warning)</span>
</div>
</div>
</td>
<td class="warning small"><div align="right">87.50%</div></td>
<td class="warning small"><div align="right">7&nbsp;/&nbsp;8</div></td>
<td class="danger big"> <div class="progress">
<div class="progress-bar bg-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
<span class="sr-only">0.00% covered (danger)</span>
</div>
</div>
</td>
<td class="danger small"><div align="right">0.00%</div></td>
<td class="danger small"><div align="right">0&nbsp;/&nbsp;1</div></td>
<td class="danger big"> <div class="progress">
<div class="progress-bar bg-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
<span class="sr-only">0.00% covered (danger)</span>
</div>
</div>
</td>
<td class="danger small"><div align="right">0.00%</div></td>
<td class="danger small"><div align="right">0&nbsp;/&nbsp;1</div></td>
</tr>
</tbody>
</table>
</div>
<footer>
<hr/>
<h4>Legend</h4>
<p>
<span class="danger"><strong>Low</strong>: 0% to 50%</span>
<span class="warning"><strong>Medium</strong>: 50% to 90%</span>
<span class="success"><strong>High</strong>: 90% to 100%</span>
</p>
<p>
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage %s</a> using <a href="%s" target="_top">%s</a> at %s.</small>
</p>
</footer>
</div>
</body>
</html>

View File

@ -0,0 +1,172 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Code Coverage for %s%esource_with_class_and_anonymous_function.php</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="_css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="_css/octicons.css" rel="stylesheet" type="text/css">
<link href="_css/style.css" rel="stylesheet" type="text/css">
<link href="_css/custom.css" rel="stylesheet" type="text/css">
</head>
<body>
<header>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.html">%s</a></li>
<li class="breadcrumb-item active">source_with_class_and_anonymous_function.php</li>
</ol>
</nav>
</div>
</div>
</div>
</header>
<div class="container-fluid">
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<td>&nbsp;</td>
<td colspan="10"><div align="center"><strong>Code Coverage</strong></div></td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="3"><div align="center"><strong>Classes and Traits</strong></div></td>
<td colspan="4"><div align="center"><strong>Functions and Methods</strong></div></td>
<td colspan="3"><div align="center"><strong>Lines</strong></div></td>
</tr>
</thead>
<tbody>
<tr>
<td class="danger">Total</td>
<td class="danger big"> <div class="progress">
<div class="progress-bar bg-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
<span class="sr-only">0.00% covered (danger)</span>
</div>
</div>
</td>
<td class="danger small"><div align="right">0.00%</div></td>
<td class="danger small"><div align="right">0&nbsp;/&nbsp;1</div></td>
<td class="danger big"> <div class="progress">
<div class="progress-bar bg-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
<span class="sr-only">0.00% covered (danger)</span>
</div>
</div>
</td>
<td class="danger small"><div align="right">0.00%</div></td>
<td class="danger small"><div align="right">0&nbsp;/&nbsp;1</div></td>
<td class="danger small"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></td>
<td class="warning big"> <div class="progress">
<div class="progress-bar bg-warning" role="progressbar" aria-valuenow="87.50" aria-valuemin="0" aria-valuemax="100" style="width: 87.50%">
<span class="sr-only">87.50% covered (warning)</span>
</div>
</div>
</td>
<td class="warning small"><div align="right">87.50%</div></td>
<td class="warning small"><div align="right">7&nbsp;/&nbsp;8</div></td>
</tr>
<tr>
<td class="danger">CoveredClassWithAnonymousFunctionInStaticMethod</td>
<td class="danger big"> <div class="progress">
<div class="progress-bar bg-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
<span class="sr-only">0.00% covered (danger)</span>
</div>
</div>
</td>
<td class="danger small"><div align="right">0.00%</div></td>
<td class="danger small"><div align="right">0&nbsp;/&nbsp;1</div></td>
<td class="danger big"> <div class="progress">
<div class="progress-bar bg-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
<span class="sr-only">0.00% covered (danger)</span>
</div>
</div>
</td>
<td class="danger small"><div align="right">0.00%</div></td>
<td class="danger small"><div align="right">0&nbsp;/&nbsp;1</div></td>
<td class="danger small">1.00</td>
<td class="warning big"> <div class="progress">
<div class="progress-bar bg-warning" role="progressbar" aria-valuenow="87.50" aria-valuemin="0" aria-valuemax="100" style="width: 87.50%">
<span class="sr-only">87.50% covered (warning)</span>
</div>
</div>
</td>
<td class="warning small"><div align="right">87.50%</div></td>
<td class="warning small"><div align="right">7&nbsp;/&nbsp;8</div></td>
</tr>
<tr>
<td class="danger" colspan="4">&nbsp;<a href="#5"><abbr title="runAnonymous()">runAnonymous</abbr></a></td>
<td class="danger big"> <div class="progress">
<div class="progress-bar bg-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
<span class="sr-only">0.00% covered (danger)</span>
</div>
</div>
</td>
<td class="danger small"><div align="right">0.00%</div></td>
<td class="danger small"><div align="right">0&nbsp;/&nbsp;1</div></td>
<td class="danger small">1.00</td>
<td class="warning big"> <div class="progress">
<div class="progress-bar bg-warning" role="progressbar" aria-valuenow="87.50" aria-valuemin="0" aria-valuemax="100" style="width: 87.50%">
<span class="sr-only">87.50% covered (warning)</span>
</div>
</div>
</td>
<td class="warning small"><div align="right">87.50%</div></td>
<td class="warning small"><div align="right">7&nbsp;/&nbsp;8</div></td>
</tr>
</tbody>
</table>
</div>
<table id="code" class="table table-borderless table-condensed">
<tbody>
<tr><td><div align="right"><a name="1"></a><a href="#1">1</a></div></td><td class="codeLine"><span class="default">&lt;?php</span></td></tr>
<tr><td><div align="right"><a name="2"></a><a href="#2">2</a></div></td><td class="codeLine"></td></tr>
<tr><td><div align="right"><a name="3"></a><a href="#3">3</a></div></td><td class="codeLine"><span class="keyword">class</span><span class="default">&nbsp;</span><span class="default">CoveredClassWithAnonymousFunctionInStaticMethod</span></td></tr>
<tr><td><div align="right"><a name="4"></a><a href="#4">4</a></div></td><td class="codeLine"><span class="keyword">{</span></td></tr>
<tr><td><div align="right"><a name="5"></a><a href="#5">5</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">public</span><span class="default">&nbsp;</span><span class="keyword">static</span><span class="default">&nbsp;</span><span class="keyword">function</span><span class="default">&nbsp;</span><span class="default">runAnonymous</span><span class="keyword">(</span><span class="keyword">)</span></td></tr>
<tr><td><div align="right"><a name="6"></a><a href="#6">6</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">{</span></td></tr>
<tr class="covered-by-large-tests popin"><td data-title="1 test covers line 7" data-content="&lt;ul&gt;&lt;li&gt;ClassWithAnonymousFunction&lt;/li&gt;&lt;/ul&gt;" data-placement="top" data-html="true"><div align="right"><a name="7"></a><a href="#7">7</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$filter</span><span class="default">&nbsp;</span><span class="keyword">=</span><span class="default">&nbsp;</span><span class="keyword">[</span><span class="default">'abc124'</span><span class="keyword">,</span><span class="default">&nbsp;</span><span class="default">'abc123'</span><span class="keyword">,</span><span class="default">&nbsp;</span><span class="default">'123'</span><span class="keyword">]</span><span class="keyword">;</span></td></tr>
<tr><td><div align="right"><a name="8"></a><a href="#8">8</a></div></td><td class="codeLine"></td></tr>
<tr class="covered-by-large-tests popin"><td data-title="1 test covers line 9" data-content="&lt;ul&gt;&lt;li&gt;ClassWithAnonymousFunction&lt;/li&gt;&lt;/ul&gt;" data-placement="top" data-html="true"><div align="right"><a name="9"></a><a href="#9">9</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">array_walk</span><span class="keyword">(</span></td></tr>
<tr class="danger"><td><div align="right"><a name="10"></a><a href="#10">10</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$filter</span><span class="keyword">,</span></td></tr>
<tr><td><div align="right"><a name="11"></a><a href="#11">11</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">function</span><span class="default">&nbsp;</span><span class="keyword">(</span><span class="keyword">&amp;</span><span class="default">$val</span><span class="keyword">,</span><span class="default">&nbsp;</span><span class="default">$key</span><span class="keyword">)</span><span class="default">&nbsp;</span><span class="keyword">{</span></td></tr>
<tr class="covered-by-large-tests popin"><td data-title="1 test covers line 12" data-content="&lt;ul&gt;&lt;li&gt;ClassWithAnonymousFunction&lt;/li&gt;&lt;/ul&gt;" data-placement="top" data-html="true"><div align="right"><a name="12"></a><a href="#12">12</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$val</span><span class="default">&nbsp;</span><span class="keyword">=</span><span class="default">&nbsp;</span><span class="default">preg_replace</span><span class="keyword">(</span><span class="default">'|[^0-9]|'</span><span class="keyword">,</span><span class="default">&nbsp;</span><span class="default">''</span><span class="keyword">,</span><span class="default">&nbsp;</span><span class="default">$val</span><span class="keyword">)</span><span class="keyword">;</span></td></tr>
<tr class="covered-by-large-tests popin"><td data-title="1 test covers line 13" data-content="&lt;ul&gt;&lt;li&gt;ClassWithAnonymousFunction&lt;/li&gt;&lt;/ul&gt;" data-placement="top" data-html="true"><div align="right"><a name="13"></a><a href="#13">13</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">}</span></td></tr>
<tr class="covered-by-large-tests popin"><td data-title="1 test covers line 14" data-content="&lt;ul&gt;&lt;li&gt;ClassWithAnonymousFunction&lt;/li&gt;&lt;/ul&gt;" data-placement="top" data-html="true"><div align="right"><a name="14"></a><a href="#14">14</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">)</span><span class="keyword">;</span></td></tr>
<tr><td><div align="right"><a name="15"></a><a href="#15">15</a></div></td><td class="codeLine"></td></tr>
<tr><td><div align="right"><a name="16"></a><a href="#16">16</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">//&nbsp;Should&nbsp;be&nbsp;covered</span></td></tr>
<tr class="covered-by-large-tests popin"><td data-title="1 test covers line 17" data-content="&lt;ul&gt;&lt;li&gt;ClassWithAnonymousFunction&lt;/li&gt;&lt;/ul&gt;" data-placement="top" data-html="true"><div align="right"><a name="17"></a><a href="#17">17</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$extravar</span><span class="default">&nbsp;</span><span class="keyword">=</span><span class="default">&nbsp;</span><span class="default">true</span><span class="keyword">;</span></td></tr>
<tr class="covered-by-large-tests popin"><td data-title="1 test covers line 18" data-content="&lt;ul&gt;&lt;li&gt;ClassWithAnonymousFunction&lt;/li&gt;&lt;/ul&gt;" data-placement="top" data-html="true"><div align="right"><a name="18"></a><a href="#18">18</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">}</span></td></tr>
<tr><td><div align="right"><a name="19"></a><a href="#19">19</a></div></td><td class="codeLine"><span class="keyword">}</span></td></tr>
</tbody>
</table>
<footer>
<hr/>
<h4>Legend</h4>
<p>
<span class="success"><strong>Executed</strong></span>
<span class="danger"><strong>Not Executed</strong></span>
<span class="warning"><strong>Dead Code</strong></span>
</p>
<p>
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage %s</a> using <a href="%s" target="_top">%s</a> at %s.</small>
</p>
<a title="Back to the top" id="toplink" href="#">
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="16" viewBox="0 0 12 16"><path fill-rule="evenodd" d="M12 11L6 5l-6 6h12z"/></svg>
</a>
</footer>
</div>
<script src="_js/jquery.min.js" type="text/javascript"></script>
<script src="_js/popper.min.js" type="text/javascript"></script>
<script src="_js/bootstrap.min.js" type="text/javascript"></script>
<script src="_js/file.js" type="text/javascript"></script>
</body>
</html>

View File

@ -0,0 +1,283 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Dashboard for %s</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="_css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="_css/nv.d3.min.css" rel="stylesheet" type="text/css">
<link href="_css/style.css" rel="stylesheet" type="text/css">
<link href="_css/custom.css" rel="stylesheet" type="text/css">
</head>
<body>
<header>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.html">%s</a></li>
<li class="breadcrumb-item active">(Dashboard)</li>
</ol>
</nav>
</div>
</div>
</div>
</header>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<h2>Classes</h2>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h3>Coverage Distribution</h3>
<div id="classCoverageDistribution" style="height: 300px;">
<svg></svg>
</div>
</div>
<div class="col-md-6">
<h3>Complexity</h3>
<div id="classComplexity" style="height: 300px;">
<svg></svg>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h3>Insufficient Coverage</h3>
<div class="scrollbox">
<table class="table">
<thead>
<tr>
<th>Class</th>
<th class="text-right">Coverage</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div class="col-md-6">
<h3>Project Risks</h3>
<div class="scrollbox">
<table class="table">
<thead>
<tr>
<th>Class</th>
<th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h2>Methods</h2>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h3>Coverage Distribution</h3>
<div id="methodCoverageDistribution" style="height: 300px;">
<svg></svg>
</div>
</div>
<div class="col-md-6">
<h3>Complexity</h3>
<div id="methodComplexity" style="height: 300px;">
<svg></svg>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h3>Insufficient Coverage</h3>
<div class="scrollbox">
<table class="table">
<thead>
<tr>
<th>Method</th>
<th class="text-right">Coverage</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div class="col-md-6">
<h3>Project Risks</h3>
<div class="scrollbox">
<table class="table">
<thead>
<tr>
<th>Method</th>
<th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<footer>
<hr/>
<p>
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage %s</a> using <a href="%s" target="_top">%s</a> at %s.</small>
</p>
</footer>
</div>
<script src="_js/jquery.min.js" type="text/javascript"></script>
<script src="_js/d3.min.js" type="text/javascript"></script>
<script src="_js/nv.d3.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
nv.addGraph(function() {
var chart = nv.models.multiBarChart();
chart.tooltips(false)
.showControls(false)
.showLegend(false)
.reduceXTicks(false)
.staggerLabels(true)
.yAxis.tickFormat(d3.format('d'));
d3.select('#classCoverageDistribution svg')
.datum(getCoverageDistributionData([0,0,0,0,0,0,0,0,0,0,0,2], "Class Coverage"))
.transition().duration(500).call(chart);
nv.utils.windowResize(chart.update);
return chart;
});
nv.addGraph(function() {
var chart = nv.models.multiBarChart();
chart.tooltips(false)
.showControls(false)
.showLegend(false)
.reduceXTicks(false)
.staggerLabels(true)
.yAxis.tickFormat(d3.format('d'));
d3.select('#methodCoverageDistribution svg')
.datum(getCoverageDistributionData([0,0,0,0,0,0,0,0,0,0,0,2], "Method Coverage"))
.transition().duration(500).call(chart);
nv.utils.windowResize(chart.update);
return chart;
});
function getCoverageDistributionData(data, label) {
var labels = [
'0%',
'0-10%',
'10-20%',
'20-30%',
'30-40%',
'40-50%',
'50-60%',
'60-70%',
'70-80%',
'80-90%',
'90-100%',
'100%'
];
var values = [];
$.each(labels, function(key) {
values.push({x: labels[key], y: data[key]});
});
return [
{
key: label,
values: values,
color: "#4572A7"
}
];
}
nv.addGraph(function() {
var chart = nv.models.scatterChart()
.showDistX(true)
.showDistY(true)
.showLegend(false)
.forceX([0, 100]);
chart.tooltipContent(function(graph) {
return '<p>' + graph.point.class + '</p>';
});
chart.xAxis.axisLabel('Code Coverage (in percent)');
chart.yAxis.axisLabel('Cyclomatic Complexity');
d3.select('#classComplexity svg')
.datum(getComplexityData([[100,1,"<a href=\"source_with_ignore.php.html#11\">Foo<\/a>"],[100,1,"<a href=\"source_with_ignore.php.html#18\">Bar<\/a>"]], 'Class Complexity'))
.transition()
.duration(500)
.call(chart);
nv.utils.windowResize(chart.update);
return chart;
});
nv.addGraph(function() {
var chart = nv.models.scatterChart()
.showDistX(true)
.showDistY(true)
.showLegend(false)
.forceX([0, 100]);
chart.tooltipContent(function(graph) {
return '<p>' + graph.point.class + '</p>';
});
chart.xAxis.axisLabel('Code Coverage (in percent)');
chart.yAxis.axisLabel('Method Complexity');
d3.select('#methodComplexity svg')
.datum(getComplexityData([[100,1,"<a href=\"source_with_ignore.php.html#13\">Foo::bar<\/a>"],[100,1,"<a href=\"source_with_ignore.php.html#23\">Bar::foo<\/a>"]], 'Method Complexity'))
.transition()
.duration(500)
.call(chart);
nv.utils.windowResize(chart.update);
return chart;
});
function getComplexityData(data, label) {
var values = [];
$.each(data, function(key) {
var value = Math.round(data[key][0]*100) / 100;
values.push({
x: value,
y: data[key][1],
class: data[key][2],
size: 0.05,
shape: 'diamond'
});
});
return [
{
key: label,
values: values,
color: "#4572A7"
}
];
}
});
</script>
</body>
</html>

View File

@ -0,0 +1,108 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Code Coverage for %s</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="_css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="_css/octicons.css" rel="stylesheet" type="text/css">
<link href="_css/style.css" rel="stylesheet" type="text/css">
<link href="_css/custom.css" rel="stylesheet" type="text/css">
</head>
<body>
<header>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item active">%s</li>
<li class="breadcrumb-item">(<a href="dashboard.html">Dashboard</a>)</li>
</ol>
</nav>
</div>
</div>
</div>
</header>
<div class="container-fluid">
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<td>&nbsp;</td>
<td colspan="9"><div align="center"><strong>Code Coverage</strong></div></td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="3"><div align="center"><strong>Lines</strong></div></td>
<td colspan="3"><div align="center"><strong>Functions and Methods</strong></div></td>
<td colspan="3"><div align="center"><strong>Classes and Traits</strong></div></td>
</tr>
</thead>
<tbody>
<tr>
<td class="danger">Total</td>
<td class="danger big"> <div class="progress">
<div class="progress-bar bg-danger" role="progressbar" aria-valuenow="50.00" aria-valuemin="0" aria-valuemax="100" style="width: 50.00%">
<span class="sr-only">50.00% covered (danger)</span>
</div>
</div>
</td>
<td class="danger small"><div align="right">50.00%</div></td>
<td class="danger small"><div align="right">1&nbsp;/&nbsp;2</div></td>
<td class="success big"> <div class="progress">
<div class="progress-bar bg-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
<span class="sr-only">100.00% covered (success)</span>
</div>
</div>
</td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">1&nbsp;/&nbsp;1</div></td>
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>
</tr>
<tr>
<td class="danger"><img src="_icons/file-code.svg" class="octicon" /><a href="source_with_ignore.php.html">source_with_ignore.php</a></td>
<td class="danger big"> <div class="progress">
<div class="progress-bar bg-danger" role="progressbar" aria-valuenow="50.00" aria-valuemin="0" aria-valuemax="100" style="width: 50.00%">
<span class="sr-only">50.00% covered (danger)</span>
</div>
</div>
</td>
<td class="danger small"><div align="right">50.00%</div></td>
<td class="danger small"><div align="right">1&nbsp;/&nbsp;2</div></td>
<td class="success big"> <div class="progress">
<div class="progress-bar bg-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
<span class="sr-only">100.00% covered (success)</span>
</div>
</div>
</td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">1&nbsp;/&nbsp;1</div></td>
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>
</tr>
</tbody>
</table>
</div>
<footer>
<hr/>
<h4>Legend</h4>
<p>
<span class="danger"><strong>Low</strong>: 0% to 50%</span>
<span class="warning"><strong>Medium</strong>: 50% to 90%</span>
<span class="success"><strong>High</strong>: 90% to 100%</span>
</p>
<p>
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage %s</a> using <a href="%s" target="_top">%s</a> at %s.</small>
</p>
</footer>
</div>
</body>
</html>

View File

@ -0,0 +1,196 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Code Coverage for %s%esource_with_ignore.php</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="_css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="_css/octicons.css" rel="stylesheet" type="text/css">
<link href="_css/style.css" rel="stylesheet" type="text/css">
<link href="_css/custom.css" rel="stylesheet" type="text/css">
</head>
<body>
<header>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.html">%s</a></li>
<li class="breadcrumb-item active">source_with_ignore.php</li>
</ol>
</nav>
</div>
</div>
</div>
</header>
<div class="container-fluid">
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<td>&nbsp;</td>
<td colspan="10"><div align="center"><strong>Code Coverage</strong></div></td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="3"><div align="center"><strong>Classes and Traits</strong></div></td>
<td colspan="4"><div align="center"><strong>Functions and Methods</strong></div></td>
<td colspan="3"><div align="center"><strong>Lines</strong></div></td>
</tr>
</thead>
<tbody>
<tr>
<td class="">Total</td>
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>
<td class="success big"> <div class="progress">
<div class="progress-bar bg-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
<span class="sr-only">100.00% covered (success)</span>
</div>
</div>
</td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">1&nbsp;/&nbsp;1</div></td>
<td class="success small"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></td>
<td class="danger big"> <div class="progress">
<div class="progress-bar bg-danger" role="progressbar" aria-valuenow="50.00" aria-valuemin="0" aria-valuemax="100" style="width: 50.00%">
<span class="sr-only">50.00% covered (danger)</span>
</div>
</div>
</td>
<td class="danger small"><div align="right">50.00%</div></td>
<td class="danger small"><div align="right">1&nbsp;/&nbsp;2</div></td>
</tr>
<tr>
<td class="" colspan="4"><a href="#28"><abbr title="baz()">baz</abbr></a></td>
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>
<td class=" small">1</td>
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>
</tr>
<tr>
<td class="">Foo</td>
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>
<td class=" small">1</td>
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>
</tr>
<tr>
<td class="" colspan="4">&nbsp;<a href="#13"><abbr title="bar()">bar</abbr></a></td>
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>
<td class=" small">1</td>
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>
</tr>
<tr>
<td class="">Bar</td>
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>
<td class=" small">1</td>
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>
</tr>
<tr>
<td class="" colspan="4">&nbsp;<a href="#23"><abbr title="foo()">foo</abbr></a></td>
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>
<td class=" small">1</td>
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>
</tr>
</tbody>
</table>
</div>
<table id="code" class="table table-borderless table-condensed">
<tbody>
<tr><td><div align="right"><a name="1"></a><a href="#1">1</a></div></td><td class="codeLine"><span class="default">&lt;?php</span></td></tr>
<tr class="covered-by-large-tests popin"><td data-title="1 test covers line 2" data-content="&lt;ul&gt;&lt;li&gt;FileWithIgnoredLines&lt;/li&gt;&lt;/ul&gt;" data-placement="top" data-html="true"><div align="right"><a name="2"></a><a href="#2">2</a></div></td><td class="codeLine"><span class="keyword">if</span><span class="default">&nbsp;</span><span class="keyword">(</span><span class="default">$neverHappens</span><span class="keyword">)</span><span class="default">&nbsp;</span><span class="keyword">{</span></td></tr>
<tr><td><div align="right"><a name="3"></a><a href="#3">3</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">//&nbsp;@codeCoverageIgnoreStart</span></td></tr>
<tr><td><div align="right"><a name="4"></a><a href="#4">4</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">print</span><span class="default">&nbsp;</span><span class="default">'*'</span><span class="keyword">;</span></td></tr>
<tr><td><div align="right"><a name="5"></a><a href="#5">5</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">//&nbsp;@codeCoverageIgnoreEnd</span></td></tr>
<tr class="danger"><td><div align="right"><a name="6"></a><a href="#6">6</a></div></td><td class="codeLine"><span class="keyword">}</span></td></tr>
<tr><td><div align="right"><a name="7"></a><a href="#7">7</a></div></td><td class="codeLine"></td></tr>
<tr><td><div align="right"><a name="8"></a><a href="#8">8</a></div></td><td class="codeLine"><span class="comment">/**</span></td></tr>
<tr><td><div align="right"><a name="9"></a><a href="#9">9</a></div></td><td class="codeLine"><span class="comment">&nbsp;*&nbsp;@codeCoverageIgnore</span></td></tr>
<tr><td><div align="right"><a name="10"></a><a href="#10">10</a></div></td><td class="codeLine"><span class="comment">&nbsp;*/</span></td></tr>
<tr><td><div align="right"><a name="11"></a><a href="#11">11</a></div></td><td class="codeLine"><span class="keyword">class</span><span class="default">&nbsp;</span><span class="default">Foo</span></td></tr>
<tr><td><div align="right"><a name="12"></a><a href="#12">12</a></div></td><td class="codeLine"><span class="keyword">{</span></td></tr>
<tr><td><div align="right"><a name="13"></a><a href="#13">13</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">public</span><span class="default">&nbsp;</span><span class="keyword">function</span><span class="default">&nbsp;</span><span class="default">bar</span><span class="keyword">(</span><span class="keyword">)</span></td></tr>
<tr><td><div align="right"><a name="14"></a><a href="#14">14</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">{</span></td></tr>
<tr><td><div align="right"><a name="15"></a><a href="#15">15</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">}</span></td></tr>
<tr><td><div align="right"><a name="16"></a><a href="#16">16</a></div></td><td class="codeLine"><span class="keyword">}</span></td></tr>
<tr><td><div align="right"><a name="17"></a><a href="#17">17</a></div></td><td class="codeLine"></td></tr>
<tr><td><div align="right"><a name="18"></a><a href="#18">18</a></div></td><td class="codeLine"><span class="keyword">class</span><span class="default">&nbsp;</span><span class="default">Bar</span></td></tr>
<tr><td><div align="right"><a name="19"></a><a href="#19">19</a></div></td><td class="codeLine"><span class="keyword">{</span></td></tr>
<tr><td><div align="right"><a name="20"></a><a href="#20">20</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span></td></tr>
<tr><td><div align="right"><a name="21"></a><a href="#21">21</a></div></td><td class="codeLine"><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@codeCoverageIgnore</span></td></tr>
<tr><td><div align="right"><a name="22"></a><a href="#22">22</a></div></td><td class="codeLine"><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></td></tr>
<tr><td><div align="right"><a name="23"></a><a href="#23">23</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">public</span><span class="default">&nbsp;</span><span class="keyword">function</span><span class="default">&nbsp;</span><span class="default">foo</span><span class="keyword">(</span><span class="keyword">)</span></td></tr>
<tr><td><div align="right"><a name="24"></a><a href="#24">24</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">{</span></td></tr>
<tr><td><div align="right"><a name="25"></a><a href="#25">25</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">}</span></td></tr>
<tr><td><div align="right"><a name="26"></a><a href="#26">26</a></div></td><td class="codeLine"><span class="keyword">}</span></td></tr>
<tr><td><div align="right"><a name="27"></a><a href="#27">27</a></div></td><td class="codeLine"></td></tr>
<tr><td><div align="right"><a name="28"></a><a href="#28">28</a></div></td><td class="codeLine"><span class="keyword">function</span><span class="default">&nbsp;</span><span class="default">baz</span><span class="keyword">(</span><span class="keyword">)</span></td></tr>
<tr><td><div align="right"><a name="29"></a><a href="#29">29</a></div></td><td class="codeLine"><span class="keyword">{</span></td></tr>
<tr><td><div align="right"><a name="30"></a><a href="#30">30</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">print</span><span class="default">&nbsp;</span><span class="default">'*'</span><span class="keyword">;</span><span class="default">&nbsp;</span><span class="comment">//&nbsp;@codeCoverageIgnore</span></td></tr>
<tr><td><div align="right"><a name="31"></a><a href="#31">31</a></div></td><td class="codeLine"><span class="keyword">}</span></td></tr>
<tr><td><div align="right"><a name="32"></a><a href="#32">32</a></div></td><td class="codeLine"></td></tr>
<tr><td><div align="right"><a name="33"></a><a href="#33">33</a></div></td><td class="codeLine"><span class="keyword">interface</span><span class="default">&nbsp;</span><span class="default">Bor</span></td></tr>
<tr><td><div align="right"><a name="34"></a><a href="#34">34</a></div></td><td class="codeLine"><span class="keyword">{</span></td></tr>
<tr><td><div align="right"><a name="35"></a><a href="#35">35</a></div></td><td class="codeLine"><span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">public</span><span class="default">&nbsp;</span><span class="keyword">function</span><span class="default">&nbsp;</span><span class="default">foo</span><span class="keyword">(</span><span class="keyword">)</span><span class="keyword">;</span></td></tr>
<tr><td><div align="right"><a name="36"></a><a href="#36">36</a></div></td><td class="codeLine"></td></tr>
<tr><td><div align="right"><a name="37"></a><a href="#37">37</a></div></td><td class="codeLine"><span class="keyword">}</span></td></tr>
</tbody>
</table>
<footer>
<hr/>
<h4>Legend</h4>
<p>
<span class="success"><strong>Executed</strong></span>
<span class="danger"><strong>Not Executed</strong></span>
<span class="warning"><strong>Dead Code</strong></span>
</p>
<p>
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage %s</a> using <a href="%s" target="_top">%s</a> at %s.</small>
</p>
<a title="Back to the top" id="toplink" href="#">
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="16" viewBox="0 0 12 16"><path fill-rule="evenodd" d="M12 11L6 5l-6 6h12z"/></svg>
</a>
</footer>
</div>
<script src="_js/jquery.min.js" type="text/javascript"></script>
<script src="_js/popper.min.js" type="text/javascript"></script>
<script src="_js/bootstrap.min.js" type="text/javascript"></script>
<script src="_js/file.js" type="text/javascript"></script>
</body>
</html>

View File

@ -0,0 +1,262 @@
<?xml version="1.0"?>
<phpunit xmlns="https://schema.phpunit.de/coverage/1.0">
<file name="BankAccount.php" path="%e">
<totals>
<lines total="33" comments="0" code="33" executable="10" executed="5" percent="50.00"/>
<methods count="4" tested="3" percent="75.00"/>
<functions count="0" tested="0" percent="0"/>
<classes count="1" tested="0" percent="0.00"/>
<traits count="0" tested="0" percent="0"/>
</totals>
<class name="BankAccount" start="2" executable="10" executed="5" crap="8.12">
<package full="" name="" sub="" category=""/>
<namespace name=""/>
<method name="getBalance" signature="getBalance()" start="6" end="9" crap="1" executable="1" executed="1" coverage="100"/>
<method name="setBalance" signature="setBalance($balance)" start="11" end="18" crap="6" executable="5" executed="0" coverage="0"/>
<method name="depositMoney" signature="depositMoney($balance)" start="20" end="25" crap="1" executable="2" executed="2" coverage="100"/>
<method name="withdrawMoney" signature="withdrawMoney($balance)" start="27" end="32" crap="1" executable="2" executed="2" coverage="100"/>
</class>
<coverage>
<line nr="8">
<covered by="BankAccountTest::testBalanceIsInitiallyZero"/>
<covered by="BankAccountTest::testDepositWithdrawMoney"/>
</line>
<line nr="22">
<covered by="BankAccountTest::testBalanceCannotBecomeNegative2"/>
<covered by="BankAccountTest::testDepositWithdrawMoney"/>
</line>
<line nr="24">
<covered by="BankAccountTest::testDepositWithdrawMoney"/>
</line>
<line nr="29">
<covered by="BankAccountTest::testBalanceCannotBecomeNegative"/>
<covered by="BankAccountTest::testDepositWithdrawMoney"/>
</line>
<line nr="31">
<covered by="BankAccountTest::testDepositWithdrawMoney"/>
</line>
</coverage>
<source>
<line no="1">
<token name="T_OPEN_TAG">&lt;?php</token>
</line>
<line no="2">
<token name="T_CLASS">class</token>
<token name="T_WHITESPACE"> </token>
<token name="T_STRING">BankAccount</token>
</line>
<line no="3">
<token name="T_OPEN_CURLY">{</token>
</line>
<line no="4">
<token name="T_WHITESPACE"> </token>
<token name="T_PROTECTED">protected</token>
<token name="T_WHITESPACE"> </token>
<token name="T_VARIABLE">$balance</token>
<token name="T_WHITESPACE"> </token>
<token name="T_EQUAL">=</token>
<token name="T_WHITESPACE"> </token>
<token name="T_LNUMBER">0</token>
<token name="T_SEMICOLON">;</token>
</line>
<line no="5"/>
<line no="6">
<token name="T_WHITESPACE"> </token>
<token name="T_PUBLIC">public</token>
<token name="T_WHITESPACE"> </token>
<token name="T_FUNCTION">function</token>
<token name="T_WHITESPACE"> </token>
<token name="T_STRING">getBalance</token>
<token name="T_OPEN_BRACKET">(</token>
<token name="T_CLOSE_BRACKET">)</token>
</line>
<line no="7">
<token name="T_WHITESPACE"> </token>
<token name="T_OPEN_CURLY">{</token>
</line>
<line no="8">
<token name="T_WHITESPACE"> </token>
<token name="T_RETURN">return</token>
<token name="T_WHITESPACE"> </token>
<token name="T_VARIABLE">$this</token>
<token name="T_OBJECT_OPERATOR">-&gt;</token>
<token name="T_STRING">balance</token>
<token name="T_SEMICOLON">;</token>
</line>
<line no="9">
<token name="T_WHITESPACE"> </token>
<token name="T_CLOSE_CURLY">}</token>
</line>
<line no="10"/>
<line no="11">
<token name="T_WHITESPACE"> </token>
<token name="T_PROTECTED">protected</token>
<token name="T_WHITESPACE"> </token>
<token name="T_FUNCTION">function</token>
<token name="T_WHITESPACE"> </token>
<token name="T_STRING">setBalance</token>
<token name="T_OPEN_BRACKET">(</token>
<token name="T_VARIABLE">$balance</token>
<token name="T_CLOSE_BRACKET">)</token>
</line>
<line no="12">
<token name="T_WHITESPACE"> </token>
<token name="T_OPEN_CURLY">{</token>
</line>
<line no="13">
<token name="T_WHITESPACE"> </token>
<token name="T_IF">if</token>
<token name="T_WHITESPACE"> </token>
<token name="T_OPEN_BRACKET">(</token>
<token name="T_VARIABLE">$balance</token>
<token name="T_WHITESPACE"> </token>
<token name="T_IS_GREATER_OR_EQUAL">&gt;=</token>
<token name="T_WHITESPACE"> </token>
<token name="T_LNUMBER">0</token>
<token name="T_CLOSE_BRACKET">)</token>
<token name="T_WHITESPACE"> </token>
<token name="T_OPEN_CURLY">{</token>
</line>
<line no="14">
<token name="T_WHITESPACE"> </token>
<token name="T_VARIABLE">$this</token>
<token name="T_OBJECT_OPERATOR">-&gt;</token>
<token name="T_STRING">balance</token>
<token name="T_WHITESPACE"> </token>
<token name="T_EQUAL">=</token>
<token name="T_WHITESPACE"> </token>
<token name="T_VARIABLE">$balance</token>
<token name="T_SEMICOLON">;</token>
</line>
<line no="15">
<token name="T_WHITESPACE"> </token>
<token name="T_CLOSE_CURLY">}</token>
<token name="T_WHITESPACE"> </token>
<token name="T_ELSE">else</token>
<token name="T_WHITESPACE"> </token>
<token name="T_OPEN_CURLY">{</token>
</line>
<line no="16">
<token name="T_WHITESPACE"> </token>
<token name="T_THROW">throw</token>
<token name="T_WHITESPACE"> </token>
<token name="T_NEW">new</token>
<token name="T_WHITESPACE"> </token>
<token name="T_STRING">RuntimeException</token>
<token name="T_SEMICOLON">;</token>
</line>
<line no="17">
<token name="T_WHITESPACE"> </token>
<token name="T_CLOSE_CURLY">}</token>
</line>
<line no="18">
<token name="T_WHITESPACE"> </token>
<token name="T_CLOSE_CURLY">}</token>
</line>
<line no="19"/>
<line no="20">
<token name="T_WHITESPACE"> </token>
<token name="T_PUBLIC">public</token>
<token name="T_WHITESPACE"> </token>
<token name="T_FUNCTION">function</token>
<token name="T_WHITESPACE"> </token>
<token name="T_STRING">depositMoney</token>
<token name="T_OPEN_BRACKET">(</token>
<token name="T_VARIABLE">$balance</token>
<token name="T_CLOSE_BRACKET">)</token>
</line>
<line no="21">
<token name="T_WHITESPACE"> </token>
<token name="T_OPEN_CURLY">{</token>
</line>
<line no="22">
<token name="T_WHITESPACE"> </token>
<token name="T_VARIABLE">$this</token>
<token name="T_OBJECT_OPERATOR">-&gt;</token>
<token name="T_STRING">setBalance</token>
<token name="T_OPEN_BRACKET">(</token>
<token name="T_VARIABLE">$this</token>
<token name="T_OBJECT_OPERATOR">-&gt;</token>
<token name="T_STRING">getBalance</token>
<token name="T_OPEN_BRACKET">(</token>
<token name="T_CLOSE_BRACKET">)</token>
<token name="T_WHITESPACE"> </token>
<token name="T_PLUS">+</token>
<token name="T_WHITESPACE"> </token>
<token name="T_VARIABLE">$balance</token>
<token name="T_CLOSE_BRACKET">)</token>
<token name="T_SEMICOLON">;</token>
</line>
<line no="23"/>
<line no="24">
<token name="T_WHITESPACE"> </token>
<token name="T_RETURN">return</token>
<token name="T_WHITESPACE"> </token>
<token name="T_VARIABLE">$this</token>
<token name="T_OBJECT_OPERATOR">-&gt;</token>
<token name="T_STRING">getBalance</token>
<token name="T_OPEN_BRACKET">(</token>
<token name="T_CLOSE_BRACKET">)</token>
<token name="T_SEMICOLON">;</token>
</line>
<line no="25">
<token name="T_WHITESPACE"> </token>
<token name="T_CLOSE_CURLY">}</token>
</line>
<line no="26"/>
<line no="27">
<token name="T_WHITESPACE"> </token>
<token name="T_PUBLIC">public</token>
<token name="T_WHITESPACE"> </token>
<token name="T_FUNCTION">function</token>
<token name="T_WHITESPACE"> </token>
<token name="T_STRING">withdrawMoney</token>
<token name="T_OPEN_BRACKET">(</token>
<token name="T_VARIABLE">$balance</token>
<token name="T_CLOSE_BRACKET">)</token>
</line>
<line no="28">
<token name="T_WHITESPACE"> </token>
<token name="T_OPEN_CURLY">{</token>
</line>
<line no="29">
<token name="T_WHITESPACE"> </token>
<token name="T_VARIABLE">$this</token>
<token name="T_OBJECT_OPERATOR">-&gt;</token>
<token name="T_STRING">setBalance</token>
<token name="T_OPEN_BRACKET">(</token>
<token name="T_VARIABLE">$this</token>
<token name="T_OBJECT_OPERATOR">-&gt;</token>
<token name="T_STRING">getBalance</token>
<token name="T_OPEN_BRACKET">(</token>
<token name="T_CLOSE_BRACKET">)</token>
<token name="T_WHITESPACE"> </token>
<token name="T_MINUS">-</token>
<token name="T_WHITESPACE"> </token>
<token name="T_VARIABLE">$balance</token>
<token name="T_CLOSE_BRACKET">)</token>
<token name="T_SEMICOLON">;</token>
</line>
<line no="30"/>
<line no="31">
<token name="T_WHITESPACE"> </token>
<token name="T_RETURN">return</token>
<token name="T_WHITESPACE"> </token>
<token name="T_VARIABLE">$this</token>
<token name="T_OBJECT_OPERATOR">-&gt;</token>
<token name="T_STRING">getBalance</token>
<token name="T_OPEN_BRACKET">(</token>
<token name="T_CLOSE_BRACKET">)</token>
<token name="T_SEMICOLON">;</token>
</line>
<line no="32">
<token name="T_WHITESPACE"> </token>
<token name="T_CLOSE_CURLY">}</token>
</line>
<line no="33">
<token name="T_CLOSE_CURLY">}</token>
</line>
<line no="34"/>
</source>
</file>
</phpunit>

View File

@ -0,0 +1,33 @@
<?xml version="1.0"?>
<phpunit xmlns="https://schema.phpunit.de/coverage/1.0">
<build time="%s" phpunit="%s" coverage="%s">
<runtime name="%s" version="%s" url="%s"/>
<driver%S/>
</build>
<project source="%s">
<tests>
<test name="BankAccountTest::testBalanceIsInitiallyZero" size="unknown" result="-1" status="UNKNOWN"/>
<test name="BankAccountTest::testBalanceCannotBecomeNegative" size="unknown" result="-1" status="UNKNOWN"/>
<test name="BankAccountTest::testBalanceCannotBecomeNegative2" size="unknown" result="-1" status="UNKNOWN"/>
<test name="BankAccountTest::testDepositWithdrawMoney" size="unknown" result="-1" status="UNKNOWN"/>
</tests>
<directory name="%s">
<totals>
<lines total="33" comments="0" code="33" executable="10" executed="5" percent="50.00"/>
<methods count="4" tested="3" percent="75.00"/>
<functions count="0" tested="0" percent="0"/>
<classes count="1" tested="0" percent="0.00"/>
<traits count="0" tested="0" percent="0"/>
</totals>
<file name="BankAccount.php" href="BankAccount.php.xml">
<totals>
<lines total="33" comments="0" code="33" executable="10" executed="5" percent="50.00"/>
<methods count="4" tested="3" percent="75.00"/>
<functions count="0" tested="0" percent="0"/>
<classes count="1" tested="0" percent="0.00"/>
<traits count="0" tested="0" percent="0"/>
</totals>
</file>
</directory>
</project>
</phpunit>

View File

@ -0,0 +1,30 @@
<?xml version="1.0"?>
<phpunit xmlns="https://schema.phpunit.de/coverage/1.0">
<build time="%s" phpunit="%s" coverage="%s">
<runtime name="%s" version="%s" url="%s"/>
<driver%S/>
</build>
<project source="%s">
<tests>
<test name="ClassWithAnonymousFunction" size="unknown" result="-1" status="UNKNOWN"/>
</tests>
<directory name="%s">
<totals>
<lines total="19" comments="2" code="17" executable="8" executed="7" percent="87.50"/>
<methods count="1" tested="0" percent="0.00"/>
<functions count="0" tested="0" percent="0"/>
<classes count="1" tested="0" percent="0.00"/>
<traits count="0" tested="0" percent="0"/>
</totals>
<file name="source_with_class_and_anonymous_function.php" href="source_with_class_and_anonymous_function.php.xml">
<totals>
<lines total="19" comments="2" code="17" executable="8" executed="7" percent="87.50"/>
<methods count="1" tested="0" percent="0.00"/>
<functions count="0" tested="0" percent="0"/>
<classes count="1" tested="0" percent="0.00"/>
<traits count="0" tested="0" percent="0"/>
</totals>
</file>
</directory>
</project>
</phpunit>

View File

@ -0,0 +1,161 @@
<?xml version="1.0"?>
<phpunit xmlns="https://schema.phpunit.de/coverage/1.0">
<file name="source_with_class_and_anonymous_function.php" path="%e">
<totals>
<lines total="19" comments="2" code="17" executable="8" executed="7" percent="87.50"/>
<methods count="1" tested="0" percent="0.00"/>
<functions count="0" tested="0" percent="0"/>
<classes count="1" tested="0" percent="0.00"/>
<traits count="0" tested="0" percent="0"/>
</totals>
<class name="CoveredClassWithAnonymousFunctionInStaticMethod" start="3" executable="8" executed="7" crap="1">
<package full="" name="" sub="" category=""/>
<namespace name=""/>
<method name="runAnonymous" signature="runAnonymous()" start="5" end="18" crap="1.00" executable="8" executed="7" coverage="87.5"/>
</class>
<coverage>
<line nr="7">
<covered by="ClassWithAnonymousFunction"/>
</line>
<line nr="9">
<covered by="ClassWithAnonymousFunction"/>
</line>
<line nr="12">
<covered by="ClassWithAnonymousFunction"/>
</line>
<line nr="13">
<covered by="ClassWithAnonymousFunction"/>
</line>
<line nr="14">
<covered by="ClassWithAnonymousFunction"/>
</line>
<line nr="17">
<covered by="ClassWithAnonymousFunction"/>
</line>
<line nr="18">
<covered by="ClassWithAnonymousFunction"/>
</line>
</coverage>
<source>
<line no="1">
<token name="T_OPEN_TAG">&lt;?php</token>
</line>
<line no="2"/>
<line no="3">
<token name="T_CLASS">class</token>
<token name="T_WHITESPACE"> </token>
<token name="T_STRING">CoveredClassWithAnonymousFunctionInStaticMethod</token>
</line>
<line no="4">
<token name="T_OPEN_CURLY">{</token>
</line>
<line no="5">
<token name="T_WHITESPACE"> </token>
<token name="T_PUBLIC">public</token>
<token name="T_WHITESPACE"> </token>
<token name="T_STATIC">static</token>
<token name="T_WHITESPACE"> </token>
<token name="T_FUNCTION">function</token>
<token name="T_WHITESPACE"> </token>
<token name="T_STRING">runAnonymous</token>
<token name="T_OPEN_BRACKET">(</token>
<token name="T_CLOSE_BRACKET">)</token>
</line>
<line no="6">
<token name="T_WHITESPACE"> </token>
<token name="T_OPEN_CURLY">{</token>
</line>
<line no="7">
<token name="T_WHITESPACE"> </token>
<token name="T_VARIABLE">$filter</token>
<token name="T_WHITESPACE"> </token>
<token name="T_EQUAL">=</token>
<token name="T_WHITESPACE"> </token>
<token name="T_OPEN_SQUARE">[</token>
<token name="T_CONSTANT_ENCAPSED_STRING">'abc124'</token>
<token name="T_COMMA">,</token>
<token name="T_WHITESPACE"> </token>
<token name="T_CONSTANT_ENCAPSED_STRING">'abc123'</token>
<token name="T_COMMA">,</token>
<token name="T_WHITESPACE"> </token>
<token name="T_CONSTANT_ENCAPSED_STRING">'123'</token>
<token name="T_CLOSE_SQUARE">]</token>
<token name="T_SEMICOLON">;</token>
</line>
<line no="8"/>
<line no="9">
<token name="T_WHITESPACE"> </token>
<token name="T_STRING">array_walk</token>
<token name="T_OPEN_BRACKET">(</token>
</line>
<line no="10">
<token name="T_WHITESPACE"> </token>
<token name="T_VARIABLE">$filter</token>
<token name="T_COMMA">,</token>
</line>
<line no="11">
<token name="T_WHITESPACE"> </token>
<token name="T_FUNCTION">function</token>
<token name="T_WHITESPACE"> </token>
<token name="T_OPEN_BRACKET">(</token>
<token name="T_AMPERSAND">&amp;</token>
<token name="T_VARIABLE">$val</token>
<token name="T_COMMA">,</token>
<token name="T_WHITESPACE"> </token>
<token name="T_VARIABLE">$key</token>
<token name="T_CLOSE_BRACKET">)</token>
<token name="T_WHITESPACE"> </token>
<token name="T_OPEN_CURLY">{</token>
</line>
<line no="12">
<token name="T_WHITESPACE"> </token>
<token name="T_VARIABLE">$val</token>
<token name="T_WHITESPACE"> </token>
<token name="T_EQUAL">=</token>
<token name="T_WHITESPACE"> </token>
<token name="T_STRING">preg_replace</token>
<token name="T_OPEN_BRACKET">(</token>
<token name="T_CONSTANT_ENCAPSED_STRING">'|[^0-9]|'</token>
<token name="T_COMMA">,</token>
<token name="T_WHITESPACE"> </token>
<token name="T_CONSTANT_ENCAPSED_STRING">''</token>
<token name="T_COMMA">,</token>
<token name="T_WHITESPACE"> </token>
<token name="T_VARIABLE">$val</token>
<token name="T_CLOSE_BRACKET">)</token>
<token name="T_SEMICOLON">;</token>
</line>
<line no="13">
<token name="T_WHITESPACE"> </token>
<token name="T_CLOSE_CURLY">}</token>
</line>
<line no="14">
<token name="T_WHITESPACE"> </token>
<token name="T_CLOSE_BRACKET">)</token>
<token name="T_SEMICOLON">;</token>
</line>
<line no="15"/>
<line no="16">
<token name="T_WHITESPACE"> </token>
<token name="T_COMMENT">// Should be covered</token>
</line>
<line no="17">
<token name="T_WHITESPACE"> </token>
<token name="T_VARIABLE">$extravar</token>
<token name="T_WHITESPACE"> </token>
<token name="T_EQUAL">=</token>
<token name="T_WHITESPACE"> </token>
<token name="T_STRING">true</token>
<token name="T_SEMICOLON">;</token>
</line>
<line no="18">
<token name="T_WHITESPACE"> </token>
<token name="T_CLOSE_CURLY">}</token>
</line>
<line no="19">
<token name="T_CLOSE_CURLY">}</token>
</line>
<line no="20"/>
</source>
</file>
</phpunit>

View File

@ -0,0 +1,30 @@
<?xml version="1.0"?>
<phpunit xmlns="https://schema.phpunit.de/coverage/1.0">
<build time="%s" phpunit="%s" coverage="%s">
<runtime name="%s" version="%s" url="%s"/>
<driver%S/>
</build>
<project source="%s">
<tests>
<test name="FileWithIgnoredLines" size="unknown" result="-1" status="UNKNOWN"/>
</tests>
<directory name="%s">
<totals>
<lines total="37" comments="12" code="25" executable="2" executed="1" percent="50.00"/>
<methods count="0" tested="0" percent="0"/>
<functions count="1" tested="1" percent="100.00"/>
<classes count="0" tested="0" percent="0"/>
<traits count="0" tested="0" percent="0"/>
</totals>
<file name="source_with_ignore.php" href="source_with_ignore.php.xml">
<totals>
<lines total="37" comments="12" code="25" executable="2" executed="1" percent="50.00"/>
<methods count="0" tested="0" percent="0"/>
<functions count="1" tested="1" percent="100.00"/>
<classes count="0" tested="0" percent="0"/>
<traits count="0" tested="0" percent="0"/>
</totals>
</file>
</directory>
</project>
</phpunit>

View File

@ -0,0 +1,187 @@
<?xml version="1.0"?>
<phpunit xmlns="https://schema.phpunit.de/coverage/1.0">
<file name="source_with_ignore.php" path="%e">
<totals>
<lines total="37" comments="12" code="25" executable="2" executed="1" percent="50.00"/>
<methods count="0" tested="0" percent="0"/>
<functions count="1" tested="1" percent="100.00"/>
<classes count="0" tested="0" percent="0"/>
<traits count="0" tested="0" percent="0"/>
</totals>
<class name="Foo" start="11" executable="0" executed="0" crap="1">
<package full="" name="" sub="" category=""/>
<namespace name=""/>
<method name="bar" signature="bar()" start="13" end="15" crap="1" executable="0" executed="0" coverage="100"/>
</class>
<class name="Bar" start="18" executable="0" executed="0" crap="1">
<package full="" name="" sub="" category=""/>
<namespace name=""/>
<method name="foo" signature="foo()" start="23" end="25" crap="1" executable="0" executed="0" coverage="100"/>
</class>
<function name="baz" signature="baz()" start="28" crap="1" executable="0" executed="0" coverage="100"/>
<coverage>
<line nr="2">
<covered by="FileWithIgnoredLines"/>
</line>
</coverage>
<source>
<line no="1">
<token name="T_OPEN_TAG">&lt;?php</token>
</line>
<line no="2">
<token name="T_IF">if</token>
<token name="T_WHITESPACE"> </token>
<token name="T_OPEN_BRACKET">(</token>
<token name="T_VARIABLE">$neverHappens</token>
<token name="T_CLOSE_BRACKET">)</token>
<token name="T_WHITESPACE"> </token>
<token name="T_OPEN_CURLY">{</token>
</line>
<line no="3">
<token name="T_WHITESPACE"> </token>
<token name="T_COMMENT">// @codeCoverageIgnoreStart</token>
</line>
<line no="4">
<token name="T_WHITESPACE"> </token>
<token name="T_PRINT">print</token>
<token name="T_WHITESPACE"> </token>
<token name="T_CONSTANT_ENCAPSED_STRING">'*'</token>
<token name="T_SEMICOLON">;</token>
</line>
<line no="5">
<token name="T_WHITESPACE"> </token>
<token name="T_COMMENT">// @codeCoverageIgnoreEnd</token>
</line>
<line no="6">
<token name="T_CLOSE_CURLY">}</token>
</line>
<line no="7"/>
<line no="8">
<token name="T_DOC_COMMENT">/**</token>
</line>
<line no="9">
<token name="T_DOC_COMMENT"> * @codeCoverageIgnore</token>
</line>
<line no="10">
<token name="T_DOC_COMMENT"> */</token>
</line>
<line no="11">
<token name="T_CLASS">class</token>
<token name="T_WHITESPACE"> </token>
<token name="T_STRING">Foo</token>
</line>
<line no="12">
<token name="T_OPEN_CURLY">{</token>
</line>
<line no="13">
<token name="T_WHITESPACE"> </token>
<token name="T_PUBLIC">public</token>
<token name="T_WHITESPACE"> </token>
<token name="T_FUNCTION">function</token>
<token name="T_WHITESPACE"> </token>
<token name="T_STRING">bar</token>
<token name="T_OPEN_BRACKET">(</token>
<token name="T_CLOSE_BRACKET">)</token>
</line>
<line no="14">
<token name="T_WHITESPACE"> </token>
<token name="T_OPEN_CURLY">{</token>
</line>
<line no="15">
<token name="T_WHITESPACE"> </token>
<token name="T_CLOSE_CURLY">}</token>
</line>
<line no="16">
<token name="T_CLOSE_CURLY">}</token>
</line>
<line no="17"/>
<line no="18">
<token name="T_CLASS">class</token>
<token name="T_WHITESPACE"> </token>
<token name="T_STRING">Bar</token>
</line>
<line no="19">
<token name="T_OPEN_CURLY">{</token>
</line>
<line no="20">
<token name="T_WHITESPACE"> </token>
<token name="T_DOC_COMMENT">/**</token>
</line>
<line no="21">
<token name="T_DOC_COMMENT"> * @codeCoverageIgnore</token>
</line>
<line no="22">
<token name="T_DOC_COMMENT"> */</token>
</line>
<line no="23">
<token name="T_WHITESPACE"> </token>
<token name="T_PUBLIC">public</token>
<token name="T_WHITESPACE"> </token>
<token name="T_FUNCTION">function</token>
<token name="T_WHITESPACE"> </token>
<token name="T_STRING">foo</token>
<token name="T_OPEN_BRACKET">(</token>
<token name="T_CLOSE_BRACKET">)</token>
</line>
<line no="24">
<token name="T_WHITESPACE"> </token>
<token name="T_OPEN_CURLY">{</token>
</line>
<line no="25">
<token name="T_WHITESPACE"> </token>
<token name="T_CLOSE_CURLY">}</token>
</line>
<line no="26">
<token name="T_CLOSE_CURLY">}</token>
</line>
<line no="27"/>
<line no="28">
<token name="T_FUNCTION">function</token>
<token name="T_WHITESPACE"> </token>
<token name="T_STRING">baz</token>
<token name="T_OPEN_BRACKET">(</token>
<token name="T_CLOSE_BRACKET">)</token>
</line>
<line no="29">
<token name="T_OPEN_CURLY">{</token>
</line>
<line no="30">
<token name="T_WHITESPACE"> </token>
<token name="T_PRINT">print</token>
<token name="T_WHITESPACE"> </token>
<token name="T_CONSTANT_ENCAPSED_STRING">'*'</token>
<token name="T_SEMICOLON">;</token>
<token name="T_WHITESPACE"> </token>
<token name="T_COMMENT">// @codeCoverageIgnore</token>
</line>
<line no="31">
<token name="T_CLOSE_CURLY">}</token>
</line>
<line no="32"/>
<line no="33">
<token name="T_INTERFACE">interface</token>
<token name="T_WHITESPACE"> </token>
<token name="T_STRING">Bor</token>
</line>
<line no="34">
<token name="T_OPEN_CURLY">{</token>
</line>
<line no="35">
<token name="T_WHITESPACE"> </token>
<token name="T_PUBLIC">public</token>
<token name="T_WHITESPACE"> </token>
<token name="T_FUNCTION">function</token>
<token name="T_WHITESPACE"> </token>
<token name="T_STRING">foo</token>
<token name="T_OPEN_BRACKET">(</token>
<token name="T_CLOSE_BRACKET">)</token>
<token name="T_SEMICOLON">;</token>
</line>
<line no="36"/>
<line no="37">
<token name="T_CLOSE_CURLY">}</token>
</line>
<line no="38"/>
</source>
</file>
</phpunit>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="%i">
<project timestamp="%i">
<file name="%s%esource_with_class_and_anonymous_function.php">
<class name="CoveredClassWithAnonymousFunctionInStaticMethod" namespace="global">
<metrics complexity="1" methods="1" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="8" coveredstatements="7" elements="9" coveredelements="7"/>
</class>
<line num="5" type="method" name="runAnonymous" visibility="public" complexity="1" crap="1.00" count="1"/>
<line num="7" type="stmt" count="1"/>
<line num="9" type="stmt" count="1"/>
<line num="10" type="stmt" count="0"/>
<line num="12" type="stmt" count="1"/>
<line num="13" type="stmt" count="1"/>
<line num="14" type="stmt" count="1"/>
<line num="17" type="stmt" count="1"/>
<line num="18" type="stmt" count="1"/>
<metrics loc="19" ncloc="17" classes="1" methods="1" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="8" coveredstatements="7" elements="9" coveredelements="7"/>
</file>
<metrics files="1" loc="19" ncloc="17" classes="1" methods="1" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="8" coveredstatements="7" elements="9" coveredelements="7"/>
</project>
</coverage>

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<crap_result>
<project>CoverageForClassWithAnonymousFunction</project>
<timestamp>%s</timestamp>
<stats>
<name>Method Crap Stats</name>
<methodCount>1</methodCount>
<crapMethodCount>0</crapMethodCount>
<crapLoad>0</crapLoad>
<totalCrap>1</totalCrap>
<crapMethodPercent>0</crapMethodPercent>
</stats>
<methods>
<method>
<package>global</package>
<className>CoveredClassWithAnonymousFunctionInStaticMethod</className>
<methodName>runAnonymous</methodName>
<methodSignature>runAnonymous()</methodSignature>
<fullMethod>runAnonymous()</fullMethod>
<crap>1</crap>
<complexity>1</complexity>
<coverage>87.5</coverage>
<crapLoad>0</crapLoad>
</method>
</methods>
</crap_result>

View File

@ -0,0 +1,12 @@
Code Coverage Report:
%s
Summary:
Classes: 0.00% (0/1)
Methods: 0.00% (0/1)
Lines: 87.50% (7/8)
CoveredClassWithAnonymousFunctionInStaticMethod
Methods: 0.00% ( 0/ 1) Lines: 87.50% ( 7/ 8)

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="%i">
<project timestamp="%i">
<file name="%s%esource_with_ignore.php">
<class name="Foo" namespace="global">
<metrics complexity="1" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
</class>
<class name="Bar" namespace="global">
<metrics complexity="1" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
</class>
<line num="2" type="stmt" count="1"/>
<line num="6" type="stmt" count="0"/>
<metrics loc="37" ncloc="25" classes="0" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="2" coveredstatements="1" elements="2" coveredelements="1"/>
</file>
<metrics files="1" loc="37" ncloc="25" classes="0" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="2" coveredstatements="1" elements="2" coveredelements="1"/>
</project>
</coverage>

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<crap_result>
<project>CoverageForFileWithIgnoredLines</project>
<timestamp>%s</timestamp>
<stats>
<name>Method Crap Stats</name>
<methodCount>2</methodCount>
<crapMethodCount>0</crapMethodCount>
<crapLoad>0</crapLoad>
<totalCrap>2</totalCrap>
<crapMethodPercent>0</crapMethodPercent>
</stats>
<methods>
<method>
<package>global</package>
<className>Foo</className>
<methodName>bar</methodName>
<methodSignature>bar()</methodSignature>
<fullMethod>bar()</fullMethod>
<crap>1</crap>
<complexity>1</complexity>
<coverage>100</coverage>
<crapLoad>0</crapLoad>
</method>
<method>
<package>global</package>
<className>Bar</className>
<methodName>foo</methodName>
<methodSignature>foo()</methodSignature>
<fullMethod>foo()</fullMethod>
<crap>1</crap>
<complexity>1</complexity>
<coverage>100</coverage>
<crapLoad>0</crapLoad>
</method>
</methods>
</crap_result>

View File

@ -0,0 +1,10 @@
Code Coverage Report:%w
%s
%w
Summary:%w
Classes: (0/0)
Methods: (0/0)
Lines: 50.00% (1/2)

View File

@ -0,0 +1,19 @@
<?php
class CoveredClassWithAnonymousFunctionInStaticMethod
{
public static function runAnonymous()
{
$filter = ['abc124', 'abc123', '123'];
array_walk(
$filter,
function (&$val, $key) {
$val = preg_replace('|[^0-9]|', '', $val);
}
);
// Should be covered
$extravar = true;
}
}

View File

@ -0,0 +1,37 @@
<?php
if ($neverHappens) {
// @codeCoverageIgnoreStart
print '*';
// @codeCoverageIgnoreEnd
}
/**
* @codeCoverageIgnore
*/
class Foo
{
public function bar()
{
}
}
class Bar
{
/**
* @codeCoverageIgnore
*/
public function foo()
{
}
}
function baz()
{
print '*'; // @codeCoverageIgnore
}
interface Bor
{
public function foo();
}

View File

@ -0,0 +1,20 @@
<?php
namespace bar\baz;
/**
* Represents foo.
*/
class source_with_namespace
{
}
/**
* @param mixed $bar
*/
function &foo($bar)
{
$baz = function () {};
$a = true ? true : false;
$b = "{$a}";
$c = "${b}";
}

View File

@ -0,0 +1,36 @@
<?php
/** Docblock */
interface FooInterface
{
public function bar();
}
class Foo
{
public function bar()
{
}
}
function baz()
{
// a one-line comment
print '*'; // a one-line comment
/* a one-line comment */
print '*'; /* a one-line comment */
/* a one-line comment
*/
print '*'; /* a one-line comment
*/
print '*'; // @codeCoverageIgnore
print '*'; // @codeCoverageIgnoreStart
print '*';
print '*'; // @codeCoverageIgnoreEnd
print '*';
}

View File

@ -0,0 +1,23 @@
<?php
namespace SebastianBergmann\CodeCoverage\TestFixture;
use stdClass;
use function array_filter;
use const ARRAY_FILTER_USE_BOTH;
class C
{
public function m(): void
{
$o = new stdClass;
array_filter(
['a' => 1, 'b' => 2, 'c' => 3, 'd' => 4],
static function ($v, $k)
{
return $k === 'b' || $v === 4;
},
ARRAY_FILTER_USE_BOTH
);
}
}

View File

@ -0,0 +1,4 @@
<?php
if ($neverHappens) {
print '*';
}

View File

@ -0,0 +1,18 @@
<?php
/**
* Represents foo.
*/
class Foo
{
}
/**
* @param mixed $bar
*/
function &foo($bar)
{
$baz = function () {};
$a = true ? true : false;
$b = "{$a}";
$c = "${b}";
}