Showing 288 of 288 total issues
Avoid variables with short names like $fx. Configured minimum length is 3. Open
Open
private function _makeHookDynamicFx(?\Closure $getFxThisFx, \Closure $fx, bool $isShort): \Closure
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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
Open
$pv = $this->parseStackTraceFrame($parentTrace[$i]);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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
Open
if ($i <= $index) {
unset($indexes[$k]);
}
- Create a ticketCreate a ticket
Each trait must be in a file by itself Open
Open
trait Phpunit9xTestCaseTrait
- Create a ticketCreate a ticket
- Exclude checks
Each trait must be in a file by itself Open
Open
abstract class TestCase extends BaseTestCase
- Create a ticketCreate a ticket
- Exclude checks
The class TestCase has a coupling between objects value of 15. Consider to reduce the number of dependencies under 13. Open
Open
abstract class TestCase extends BaseTestCase
{
use Phpunit9xTestCaseTrait;
use WarnDynamicPropertyTrait;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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
Open
public function onHookDynamic(string $spot, \Closure $getFxThisFx, \Closure $fx, array $args = [], int $priority = 5): int
- Create a ticketCreate a ticket
Method onHookDynamicShort
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function onHookDynamicShort(string $spot, \Closure $getFxThisFx, \Closure $fx, array $args = [], int $priority = 5): int
- Create a ticketCreate a ticket
Property name "$_instance" should not be prefixed with an underscore to indicate visibility Open
Open
private static ?Factory $_instance = null;
- Create a ticketCreate a ticket
- Exclude checks
Property name "$_previousTrace" should not be prefixed with an underscore to indicate visibility Open
Open
private array $_previousTrace = [];
- Create a ticketCreate a ticket
- Exclude checks
Method name "_mergeSeeds" should not be prefixed with an underscore to indicate visibility Open
Open
protected function _mergeSeeds(...$seeds)
- Create a ticketCreate a ticket
- Exclude checks
Possible parse error: class missing opening or closing brace Open
Open
class Console extends RendererAbstract
- Create a ticketCreate a ticket
- Exclude checks
Property name "$_app" should not be prefixed with an underscore to indicate visibility Open
Open
private ?QuietObjectWrapper $_app = null;
- Create a ticketCreate a ticket
- Exclude checks
Property name "$_initialized" should not be prefixed with an underscore to indicate visibility Open
Open
private bool $_initialized = false;
- Create a ticketCreate a ticket
- Exclude checks
Possible parse error: class missing opening or closing brace Open
Open
class Console extends RendererAbstract
- Create a ticketCreate a ticket
- Exclude checks
Property name "$_owner" should not be prefixed with an underscore to indicate visibility Open
Open
private ?QuietObjectWrapper $_owner = null;
- Create a ticketCreate a ticket
- Exclude checks
Property name "$_elementNameCounts" should not be prefixed with an underscore to indicate visibility Open
Open
private array $_elementNameCounts = [];
- Create a ticketCreate a ticket
- Exclude checks
Method name "_onNotSuccessfulTest" should not be prefixed with an underscore to indicate visibility Open
Open
protected function _onNotSuccessfulTest(\Throwable $e): void
- Create a ticketCreate a ticket
- Exclude checks
Method name "_newObject" should not be prefixed with an underscore to indicate visibility Open
Open
protected function _newObject(string $className, array $ctorArgs): object
- Create a ticketCreate a ticket
- Exclude checks
Method name "_factory" should not be prefixed with an underscore to indicate visibility Open
Open
protected function _factory($seed, array $defaults): object
- Create a ticketCreate a ticket
- Exclude checks