Showing 288 of 288 total issues

Avoid variables with short names like $fx. Configured minimum length is 3.
Open

    private function _makeHookDynamicFx(?\Closure $getFxThisFx, \Closure $fx, bool $isShort): \Closure
Severity: Minor
Found in src/HookTrait.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

Avoid variables with short names like $pv. Configured minimum length is 3.
Open

            $pv = $this->parseStackTraceFrame($parentTrace[$i]);

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

Avoid deeply nested control flow statements.
Open

                                if ($i <= $index) {
                                    unset($indexes[$k]);
                                }
Severity: Major
Found in src/HookTrait.php - About 45 mins to fix

Each trait must be in a file by itself
Open

    trait Phpunit9xTestCaseTrait
Severity: Minor
Found in src/Phpunit/TestCase.php by phpcodesniffer

Each trait must be in a file by itself
Open

abstract class TestCase extends BaseTestCase
Severity: Minor
Found in src/Phpunit/TestCase.php by phpcodesniffer

The class TestCase has a coupling between objects value of 15. Consider to reduce the number of dependencies under 13.
Open

abstract class TestCase extends BaseTestCase
{
    use Phpunit9xTestCaseTrait;
    use WarnDynamicPropertyTrait;

Severity: Minor
Found in src/Phpunit/TestCase.php by phpmd

CouplingBetweenObjects

Since: 1.1.0

A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

Example

class Foo {
    /**
     * @var \foo\bar\X
     */
    private $x = null;

    /**
     * @var \foo\bar\Y
     */
    private $y = null;

    /**
     * @var \foo\bar\Z
     */
    private $z = null;

    public function setFoo(\Foo $foo) {}
    public function setBar(\Bar $bar) {}
    public function setBaz(\Baz $baz) {}

    /**
     * @return \SplObjectStorage
     * @throws \OutOfRangeException
     * @throws \InvalidArgumentException
     * @throws \ErrorException
     */
    public function process(\Iterator $it) {}

    // ...
}

Source https://phpmd.org/rules/design.html#couplingbetweenobjects

Method onHookDynamic has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function onHookDynamic(string $spot, \Closure $getFxThisFx, \Closure $fx, array $args = [], int $priority = 5): int
Severity: Minor
Found in src/HookTrait.php - About 35 mins to fix

Method onHookDynamicShort has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function onHookDynamicShort(string $spot, \Closure $getFxThisFx, \Closure $fx, array $args = [], int $priority = 5): int
Severity: Minor
Found in src/HookTrait.php - About 35 mins to fix

Property name "$_instance" should not be prefixed with an underscore to indicate visibility
Open

    private static ?Factory $_instance = null;
Severity: Minor
Found in src/Factory.php by phpcodesniffer

Property name "$_previousTrace" should not be prefixed with an underscore to indicate visibility
Open

    private array $_previousTrace = [];
Severity: Minor
Found in src/DebugTrait.php by phpcodesniffer

Method name "_mergeSeeds" should not be prefixed with an underscore to indicate visibility
Open

    protected function _mergeSeeds(...$seeds)
Severity: Minor
Found in src/Factory.php by phpcodesniffer

Possible parse error: class missing opening or closing brace
Open

class Console extends RendererAbstract

Property name "$_app" should not be prefixed with an underscore to indicate visibility
Open

    private ?QuietObjectWrapper $_app = null;
Severity: Minor
Found in src/AppScopeTrait.php by phpcodesniffer

Property name "$_initialized" should not be prefixed with an underscore to indicate visibility
Open

    private bool $_initialized = false;
Severity: Minor
Found in src/InitializerTrait.php by phpcodesniffer

Possible parse error: class missing opening or closing brace
Open

class Console extends RendererAbstract

Property name "$_owner" should not be prefixed with an underscore to indicate visibility
Open

    private ?QuietObjectWrapper $_owner = null;
Severity: Minor
Found in src/TrackableTrait.php by phpcodesniffer

Property name "$_elementNameCounts" should not be prefixed with an underscore to indicate visibility
Open

    private array $_elementNameCounts = [];
Severity: Minor
Found in src/ContainerTrait.php by phpcodesniffer

Method name "_onNotSuccessfulTest" should not be prefixed with an underscore to indicate visibility
Open

    protected function _onNotSuccessfulTest(\Throwable $e): void
Severity: Minor
Found in src/Phpunit/TestCase.php by phpcodesniffer

Method name "_newObject" should not be prefixed with an underscore to indicate visibility
Open

    protected function _newObject(string $className, array $ctorArgs): object
Severity: Minor
Found in src/Factory.php by phpcodesniffer

Method name "_factory" should not be prefixed with an underscore to indicate visibility
Open

    protected function _factory($seed, array $defaults): object
Severity: Minor
Found in src/Factory.php by phpcodesniffer
Severity
Category
Status
Source
Language