eugene-matvejev/battleship-game-api

View on GitHub

Showing 153 of 153 total issues

Method name "GameControllerTest::successfulInitAction_XML" is not in camel caps format
Open

    public function successfulInitAction_XML()

Function successfulInitAction_XML has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function successfulInitAction_XML()
    {
        $client = static::$client;
        $client->request(
            Request::METHOD_POST,
Severity: Minor
Found in tests/phpunit/GameBundle/Controller/GameControllerTest.php - About 35 mins 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

Function unsuccessfulTurnActionOnDeadCell has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function unsuccessfulTurnActionOnDeadCell(array $response)
    {
        foreach ($response as $battlefield) {
            if ($battlefield->player->flags === PlayerModel::FLAG_AI_CONTROLLED) {
                foreach ($battlefield->cells as $cell) {
Severity: Minor
Found in tests/phpunit/GameBundle/Controller/GameControllerTest.php - About 35 mins 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

Function getAdjacentCells has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getAdjacentCells(Battlefield $battlefield, int $levels = 1, int $onlyFlag = CellModel::FLAG_NONE, int $excludeFlag = CellModel::FLAG_NONE) : array
    {
        $cells = [];
        foreach (static::$extendedPaths as $path) {
            $this->setPath($path);
Severity: Minor
Found in src/GameBundle/Service/CoordinateSystem/PathProcessor.php - About 35 mins 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

Method name "GameControllerTest::successfulInitAction_JSON" is not in camel caps format
Open

    public function successfulInitAction_JSON()

Missing class import via use statement (line '34', column '32').
Open

        $this->timestamp = new \DateTime();

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 '31', column '34').
Open

                $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
Severity: Minor
Found in app/AppKernel.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 '19', column '17').
Open

            new JMS\SerializerBundle\JMSSerializerBundle(),
Severity: Minor
Found in app/AppKernel.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 '32', column '34').
Open

                $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
Severity: Minor
Found in app/AppKernel.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 '90', column '24').
Open

        $method = (new \ReflectionClass(get_class($object)))->getMethod($methodName);

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 '47', column '20').
Open

        return new \AppKernel('test', true);

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 '16', column '17').
Open

            new Symfony\Bundle\MonologBundle\MonologBundle(),
Severity: Minor
Found in app/AppKernel.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 '12', column '17').
Open

            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
Severity: Minor
Found in app/AppKernel.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 '15', column '17').
Open

            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
Severity: Minor
Found in app/AppKernel.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 '17', column '17').
Open

            new Symfony\Bundle\TwigBundle\TwigBundle(),
Severity: Minor
Found in app/AppKernel.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 '30').
Open

            $bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
Severity: Minor
Found in app/AppKernel.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 '30', column '34').
Open

                $bundles[] = new Nelmio\ApiDocBundle\NelmioApiDocBundle();
Severity: Minor
Found in app/AppKernel.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 '21', column '17').
Open

            new EM\FoundationBundle\FoundationBundle(),
Severity: Minor
Found in app/AppKernel.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 '26', column '30').
Open

            $bundles[] = new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle();
Severity: Minor
Found in app/AppKernel.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 '22', column '17').
Open

            new EM\GameBundle\GameBundle()
Severity: Minor
Found in app/AppKernel.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

Severity
Category
Status
Source
Language