pixelfederation/swoole-bundle

View on GitHub

Showing 252 of 252 total issues

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

    private function mergeLoadedConfig(array $loadedConfig, array $iniConfig): string
    {
        $content = '';

        foreach ($loadedConfig as $name => $value) {
Severity: Minor
Found in src/Common/XdebugHandler/XdebugHandler.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

class MethodForwarderGenerator

Possible parse error: class missing opening or closing brace
Open

class MethodForwarderGenerator

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) {

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) {

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

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

            throw new \LogicException('Cannot register a bag when the session is already started.');

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 '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 '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

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

        throw new \UnexpectedValueException('Primary server port was not found.');

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

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

            throw new \RuntimeException(sprintf('Factory methods missing for class %s', $instance::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 '48', column '23').
Open

            throw new \UnexpectedValueException('Cannot obtain array of doctrine connections.');

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

            throw new \RuntimeException(\sprintf('Could not write prepared temporary php ini file to "%s".', $tempIniFilePath));

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

            throw new \InvalidArgumentException(\sprintf('The SessionBagInterface `%s` is not registered.', $name));

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

                throw new \RuntimeException(sprintf('Missing method %s in class %s', $factoryMethod, $instance::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