src/Phan/Language/EmptyUnionType.php

Summary

Maintainability
F
6 days
Test Coverage

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
Severity: Major
Found in src/Phan/Language/EmptyUnionType.php - About 4 days to fix

    File EmptyUnionType.php has 865 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    declare(strict_types=1);
    
    namespace Phan\Language;
    Severity: Major
    Found in src/Phan/Language/EmptyUnionType.php - About 2 days to fix

      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
      Severity: Minor
      Found in src/Phan/Language/EmptyUnionType.php by phpmd

      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
      Severity: Minor
      Found in src/Phan/Language/EmptyUnionType.php by phpmd

      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
      Severity: Minor
      Found in src/Phan/Language/EmptyUnionType.php by phpmd

      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
      Severity: Minor
      Found in src/Phan/Language/EmptyUnionType.php by phpmd

      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
      Severity: Minor
      Found in src/Phan/Language/EmptyUnionType.php by phpmd

      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
      Severity: Minor
      Found in src/Phan/Language/EmptyUnionType.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

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

          public function makeFromFilter(Closure $cb): UnionType
      Severity: Minor
      Found in src/Phan/Language/EmptyUnionType.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

      There are no issues that match your filters.

      Category
      Status