Dhii/simple-test-abstract

View on GitHub
src/Runner/AbstractRunner.php

Summary

Maintainability
A
3 hrs
Test Coverage

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) {
Severity: Major
Found in src/Runner/AbstractRunner.php - About 2 hrs to fix

    Method _createResultFromTest has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        abstract protected function _createResultFromTest(Test\TestBaseInterface $test, $message, $status, $assertionCount, $runnerCode, $time, $memory);
    Severity: Major
    Found in src/Runner/AbstractRunner.php - About 50 mins to fix

      Method _processTestResult has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          protected function _processTestResult(Test\TestBaseInterface $test, $status, $message, $assertionCount, $time, $memory)
      Severity: Minor
      Found in src/Runner/AbstractRunner.php - About 45 mins to fix

        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;
        Severity: Minor
        Found in src/Runner/AbstractRunner.php by phpmd

        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();
        Severity: Minor
        Found in src/Runner/AbstractRunner.php by phpmd

        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();
        Severity: Minor
        Found in src/Runner/AbstractRunner.php by phpmd

        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();
        Severity: Minor
        Found in src/Runner/AbstractRunner.php by phpmd

        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();
        Severity: Minor
        Found in src/Runner/AbstractRunner.php by phpmd

        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 _afterTest is not named in camelCase.
        Open

            protected function _afterTest(Test\ResultInterface $result)
            {
                $status = $result->getStatus();
                $this->_getCoordinator()->afterRunTest($result, $this);
                ob_end_flush();
        Severity: Minor
        Found in src/Runner/AbstractRunner.php by phpmd

        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;
            }
        Severity: Minor
        Found in src/Runner/AbstractRunner.php by phpmd

        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;
        Severity: Minor
        Found in src/Runner/AbstractRunner.php by phpmd

        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,
        Severity: Minor
        Found in src/Runner/AbstractRunner.php by phpmd

        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;
        Severity: Minor
        Found in src/Runner/AbstractRunner.php by phpmd

        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;
        Severity: Minor
        Found in src/Runner/AbstractRunner.php by phpmd

        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;
        Severity: Minor
        Found in src/Runner/AbstractRunner.php by phpmd

        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;
        Severity: Minor
        Found in src/Runner/AbstractRunner.php by phpmd

        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);
        Severity: Minor
        Found in src/Runner/AbstractRunner.php by phpmd

        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;
            }
        Severity: Minor
        Found in src/Runner/AbstractRunner.php by phpmd

        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 _getStatAggregator is not named in camelCase.
        Open

            protected function _getStatAggregator()
            {
                return $this->statAggregator;
            }
        Severity: Minor
        Found in src/Runner/AbstractRunner.php by phpmd

        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);
        
        
        Severity: Minor
        Found in src/Runner/AbstractRunner.php by phpmd

        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'));
                }
        Severity: Minor
        Found in src/Runner/AbstractRunner.php by phpmd

        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);
        Severity: Minor
        Found in src/Runner/AbstractRunner.php by phpmd

        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) {
        Severity: Minor
        Found in src/Runner/AbstractRunner.php by phpmd

        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();
        Severity: Minor
        Found in src/Runner/AbstractRunner.php by phpmd

        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

        There are no issues that match your filters.

        Category
        Status