jaroslavtyc/drd-plus-codes

View on GitHub

Showing 591 of 591 total issues

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

    public static function getSabersAndBowieKnivesValues(bool $withCustomValues = true): array
Severity: Minor
Found in Codes/Armaments/MeleeWeaponCode.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 getUnarmedValues has a boolean flag argument $withCustomValues, which is a certain sign of a Single Responsibility Principle violation.
Open

    public static function getUnarmedValues(bool $withCustomValues = true): array
Severity: Minor
Found in Codes/Armaments/MeleeWeaponCode.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 '20', column '23').
Open

            throw new \DrdPlus\Codes\Partials\Exceptions\UnknownValueForCode(

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 '35', column '43').
Open

        $translatableExtendableCode = new \ReflectionClass(TranslatableExtendableCode::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

Remove error control operator '@' on line 94.
Open

    public function I_get_warning_for_unknown_locale()
    {
        /** @var AbstractTheurgistCode $sutClass */
        $sutClass = self::getSutClass();
        foreach ($sutClass::getPossibleValues() as $value) {

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

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

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

    public static function getKnivesAndDaggersValues(bool $withCustomValues = true): array
Severity: Minor
Found in Codes/Armaments/MeleeWeaponCode.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 '26', column '27').
Open

        $reflection = new \ReflectionClass(self::getSutClass());

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 '540', column '32').
Open

        $reflectionClass = new \ReflectionClass(MeleeWeaponCode::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 '27').
Open

        $constants = (new \ReflectionClass($sutClass))->getConstants();

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 '88', column '18').
Open

        if ((new \ReflectionClass($sutClass))->isAbstract()) {

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

            $reflection = new \ReflectionClass($codeClass);
Severity: Minor
Found in tests/Codes/AllCodesTest.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 too many return statements within this method.
Open

            return str_replace('_', ' ', $code); // just replacing underscores by spaces
Severity: Major
Found in Codes/Partials/TranslatableCode.php - About 30 mins to fix

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

        public static function getVoulgesAndTridentsValues(bool $withCustomValues = true): array
    Severity: Minor
    Found in Codes/Armaments/MeleeWeaponCode.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 '93', column '30').
    Open

            $sutClass::getIt(new \DateTime());
    Severity: Minor
    Found in tests/Codes/AbstractCodeTest.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 too many return statements within this method.
    Open

                    return $translations[$plural][$code];
    Severity: Major
    Found in Codes/Partials/TranslatableCode.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return $translations[$plural][$code];
      Severity: Major
      Found in Codes/Partials/TranslatableCode.php - About 30 mins to fix

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

            public static function getThrowingWeaponsValues(bool $withCustomValues = true): array
        Severity: Minor
        Found in Codes/Armaments/RangedWeaponCode.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 '103', column '27').
        Open

                $constants = (new \ReflectionClass($sutClass))->getConstants();
        Severity: Minor
        Found in tests/Codes/AbstractCodeTest.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 '23', column '27').
        Open

                $reflection = new \ReflectionClass(Code::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

        Avoid too many return statements within this method.
        Open

                return str_replace('_', ' ', $code); // just replacing underscores by spaces
        Severity: Major
        Found in Codes/Partials/TranslatableCode.php - About 30 mins to fix
          Severity
          Category
          Status
          Source
          Language