pixelfederation/swoole-bundle

View on GitHub

Showing 252 of 252 total issues

Possible parse error: class missing opening or closing brace
Open

final class ContainerModifier

Multi-line use declarations must define one parameter per line
Open

            ) use ($servicePoolContainer, $instantiator, $factoryConfig, $mutex, $globalInstancesLimit) {

Multi-line use declarations must define one parameter per line
Open

            ) use ($servicePoolContainer, $instantiator, $factoryConfig, $mutex, $globalInstancesLimit) {

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

    private function prepareConnectionsForProxification(ContainerBuilder $container, array $connectionSvcIds): void
    {
        $dbalAliveKeeperDef = $container->findDefinition(DBALPlatformAliveKeeper::class);
        $aliveKeepers = $dbalAliveKeeperDef->getArgument(1);
        $dbalAliveKeeperDef->setArgument(1, []);
Severity: Minor
Found in src/Bridge/Doctrine/DoctrineProcessor.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

Possible parse error: class missing opening or closing brace
Open

final class ContainerModifier

Multi-line use declarations must define one parameter per line
Open

            ) use ($servicePoolContainer, $instantiator, $factoryConfig, $mutex, $globalInstancesLimit) {

Possible parse error: class missing opening or closing brace
Open

class MethodForwarderGenerator

The method fromAddressPort has a boolean flag argument $enableSsl, which is a certain sign of a Single Responsibility Principle violation.
Open

    public static function fromAddressPort(string $addressPort = '127.0.0.1:9501', string $socketType = 'tcp', bool $enableSsl = false): self
Severity: Minor
Found in src/Server/Config/Socket.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method __construct has a boolean flag argument $running, which is a certain sign of a Single Responsibility Principle violation.
Open

        private bool $running = false
Severity: Minor
Found in src/Server/HttpServer.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

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

            throw new \RuntimeException(sprintf('Mutex cannot be released by %d.', $possibleOwnerId));

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 '133', column '27').
Open

                throw new \RuntimeException(\sprintf('Could not get contents of ini file "%s".', $iniFile));

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

The method getContainerInternalsForMethod has a boolean flag argument $isExtension, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getContainerInternalsForMethod(ReflectionMethod $method, bool $isExtension = false): array

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

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

            throw new \UnexpectedValueException(\sprintf('Unexpected class instance: %s ', $service::class));

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 '72', column '23').
Open

            throw new \InvalidArgumentException('To interact with console, SymfonyStyle object must be provided as "symfonyStyle" attribute.');

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 '19').
Open

        throw new \OutOfRangeException('Bytes number cannot be negative.');
Severity: Minor
Found in src/functions.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 '42', column '23').
Open

            throw new \UnexpectedValueException('Cannot obtain array of entity managers.');

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 '29').
Open

            $property = new \ReflectionProperty($observer, $propertyName);

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

The method __construct has a boolean flag argument $trustAllProxies, which is a certain sign of a Single Responsibility Principle violation.
Open

        private bool $trustAllProxies = false

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

Missing class import via use statement (line '50', column '31').
Open

            $reflection = new \ReflectionClass(ServicePool::class);

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 '23').
Open

            throw new \UnexpectedValueException(\sprintf('Invalid service - expected %s, got %s', ObjectManager::class, $service::class));

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