Method _runTest
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _runTest(Test\TestBaseInterface $test)
{
$assertionMaker = $this->_getAssertionMaker();
$countAssertions = $assertionMaker instanceof Assertion\AccountableInterface;
if ($countAssertions) {
Method _createResultFromTest
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
abstract protected function _createResultFromTest(Test\TestBaseInterface $test, $message, $status, $assertionCount, $runnerCode, $time, $memory);
Method _processTestResult
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function _processTestResult(Test\TestBaseInterface $test, $status, $message, $assertionCount, $time, $memory)
The class AbstractRunner has a coupling between objects value of 20. Consider to reduce the number of dependencies under 13. Open
abstract class AbstractRunner implements RunnerInterface
{
protected $coordinator;
protected $assertionMaker;
protected $statAggregator;
- Read upRead up
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
Avoid unused local variables such as '$status'. Open
$status = $result->getStatus();
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
The variable $_test is not named in camelCase. Open
protected function _runAll($tests)
{
$this->_validateTestList($tests);
$results = array();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_test is not named in camelCase. Open
protected function _runAll($tests)
{
$this->_validateTestList($tests);
$results = array();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_test is not named in camelCase. Open
protected function _runAll($tests)
{
$this->_validateTestList($tests);
$results = array();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The method _getStatAggregator is not named in camelCase. Open
protected function _getStatAggregator()
{
return $this->statAggregator;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method _getCoordinator is not named in camelCase. Open
protected function _getCoordinator()
{
return $this->coordinator;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method _setAssertionMaker is not named in camelCase. Open
protected function _setAssertionMaker(Assertion\MakerInterface $assertionMaker)
{
$this->assertionMaker = $assertionMaker;
return $this;
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method _afterRunAll is not named in camelCase. Open
protected function _afterRunAll($results)
{
$this->_getCoordinator()->beforeRunTestList($results, $this);
return $this;
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method _getAssertionMaker is not named in camelCase. Open
protected function _getAssertionMaker()
{
return $this->assertionMaker;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method _setStatAggregator is not named in camelCase. Open
protected function _setStatAggregator(Stats\AggregatorInterface $aggregator)
{
$this->statAggregator = $aggregator;
return $this;
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method _createResultFromTest is not named in camelCase. Open
abstract protected function _createResultFromTest(Test\TestBaseInterface $test, $message, $status, $assertionCount, $runnerCode, $time, $memory);
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method _setCoordinator is not named in camelCase. Open
protected function _setCoordinator(Coordinator\CoordinatorInterface $coordinator)
{
$this->coordinator = $coordinator;
return $this;
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method _beforeTest is not named in camelCase. Open
protected function _beforeTest(Test\TestBaseInterface $test)
{
ob_start();
$this->_getCoordinator()->beforeRunTest($test, $this);
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method _afterTest is not named in camelCase. Open
protected function _afterTest(Test\ResultInterface $result)
{
$status = $result->getStatus();
$this->_getCoordinator()->afterRunTest($result, $this);
ob_end_flush();
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method _processTestResult is not named in camelCase. Open
protected function _processTestResult(Test\TestBaseInterface $test, $status, $message, $assertionCount, $time, $memory)
{
$result = $this->_createResultFromTest(
$test,
$message,
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method _runAll is not named in camelCase. Open
protected function _runAll($tests)
{
$this->_validateTestList($tests);
$results = array();
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method _validateTestList is not named in camelCase. Open
protected function _validateTestList($tests)
{
if (!is_array($tests) && !($tests instanceof \Traversable)) {
throw new UnexpectedValueException(sprintf('Tests must be a valid traversable structure'));
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method _beforeRunAll is not named in camelCase. Open
protected function _beforeRunAll($tests)
{
$this->_getCoordinator()->beforeRunTestList($tests, $this);
return $this;
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method _createResultSet is not named in camelCase. Open
abstract protected function _createResultSet($results);
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method _runTest is not named in camelCase. Open
protected function _runTest(Test\TestBaseInterface $test)
{
$assertionMaker = $this->_getAssertionMaker();
$countAssertions = $assertionMaker instanceof Assertion\AccountableInterface;
if ($countAssertions) {
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}