EmptyUnionType
has 202 functions (exceeds 20 allowed). Consider refactoring. Open
final class EmptyUnionType extends UnionType
{
/**
* An optional list of types represented by this union
* @internal
File EmptyUnionType.php
has 865 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace Phan\Language;
The class EmptyUnionType has 99 non-getter- and setter-methods. Consider refactoring EmptyUnionType to keep number of methods under 25. Open
final class EmptyUnionType extends UnionType
{
/**
* An optional list of types represented by this union
* @internal
- Read upRead up
- Exclude checks
TooManyMethods
Since: 0.1
A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
The default was changed from 10 to 25 in PHPMD 2.3.
Example
Source https://phpmd.org/rules/codesize.html#toomanymethods
The class EmptyUnionType has an overall complexity of 212 which is very high. The configured complexity threshold is 50. Open
final class EmptyUnionType extends UnionType
{
/**
* An optional list of types represented by this union
* @internal
- Exclude checks
The class EmptyUnionType has 98 public methods. Consider refactoring EmptyUnionType to keep number of public methods under 10. Open
final class EmptyUnionType extends UnionType
{
/**
* An optional list of types represented by this union
* @internal
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
The class EmptyUnionType has 201 public methods and attributes. Consider reducing the number of public items to less than 45. Open
final class EmptyUnionType extends UnionType
{
/**
* An optional list of types represented by this union
* @internal
- Read upRead up
- Exclude checks
ExcessivePublicCount
Since: 0.1
A large number of public methods and attributes declared in a class can indicate the class may need to be broken up as increased effort will be required to thoroughly test it.
Example
public class Foo {
public $value;
public $something;
public $var;
// [... more more public attributes ...]
public function doWork() {}
public function doMoreWork() {}
public function doWorkAgain() {}
// [... more more public methods ...]
}
Source https://phpmd.org/rules/codesize.html#excessivepubliccount
The class EmptyUnionType has 1654 lines of code. Current threshold is 1000. Avoid really long classes. Open
final class EmptyUnionType extends UnionType
{
/**
* An optional list of types represented by this union
* @internal
- Exclude checks
The class EmptyUnionType has a coupling between objects value of 17. Consider to reduce the number of dependencies under 13. Open
final class EmptyUnionType extends UnionType
{
/**
* An optional list of types represented by this union
* @internal
- Read upRead up
- 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
Avoid variables with short names like $cb. Configured minimum length is 3. Open
public function makeFromFilter(Closure $cb): UnionType
- Read upRead up
- 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;
}
}
}