elazar/phantestic

View on GitHub

Showing 9 of 9 total issues

Function getIterator has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function getIterator()
    {
        $classmap = $this->getClassmap();
        $filter = $this->filter;
        $generator = $this->generator;
Severity: Minor
Found in src/Loader/ClassmapObjectLoader.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Missing class import via use statement (line '47', column '30').
Open

            $reflector = new \ReflectionClass(get_class($case->getResult()));
Severity: Minor
Found in src/Runner/LocalRunner.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '79', column '23').
Open

            throw new \DomainException(
Severity: Minor
Found in src/Runner/LocalRunner.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '63', column '24').
Open

            return new \Phantestic\Test\Test($callback, $name);
Severity: Minor
Found in src/Loader/ClassmapObjectLoader.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '27', column '23').
Open

            throw new \RuntimeException(

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '76', column '30').
Open

            $reflector = new \ReflectionClass($class);
Severity: Minor
Found in src/Loader/ClassmapObjectLoader.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '79', column '19').
Open

        throw new \ErrorException($message, 0, $severity, $file, $line);
Severity: Minor
Found in src/Test/Test.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Avoid unused parameters such as '$class'.
Open

        return function ($file, $class, $method) {
Severity: Minor
Found in src/Loader/ClassmapObjectLoader.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

The method returnExitStatus() contains an exit expression.
Open

        exit(1);
Severity: Minor
Found in src/Handler/CliOutputHandler.php by phpmd

ExitExpression

Since: 0.2

An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

Example

class Foo {
    public function bar($param)  {
        if ($param === 42) {
            exit(23);
        }
    }
}

Source https://phpmd.org/rules/design.html#exitexpression

Severity
Category
Status
Source
Language