hrodic/php-integration-testing

View on GitHub
src/Driver/AMQPConnection.php

Summary

Maintainability
A
1 hr
Test Coverage

Method create has 12 arguments (exceeds 4 allowed). Consider refactoring.
Open

        string $host,
        int $port,
        string $user,
        string $password,
        string $vHost = '/',
Severity: Major
Found in src/Driver/AMQPConnection.php - About 1 hr to fix

    The method create has 12 parameters. Consider reducing the number of parameters to less than 10.
    Open

        public static function create(
            string $host,
            int $port,
            string $user,
            string $password,
    Severity: Minor
    Found in src/Driver/AMQPConnection.php by phpmd

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

            bool $insist = false,
    Severity: Minor
    Found in src/Driver/AMQPConnection.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 create has a boolean flag argument $keepAlive, which is a certain sign of a Single Responsibility Principle violation.
    Open

            bool $keepAlive = false,
    Severity: Minor
    Found in src/Driver/AMQPConnection.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

    There are no issues that match your filters.

    Category
    Status