Showing 4,939 of 4,939 total issues

Method generateIssueMap has 4385 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private static function generateIssueMap(): array
    {
        // phpcs:disable Generic.Files.LineLength
        /**
         * @var list<Issue>
Severity: Major
Found in src/Phan/Issue.php - About 3 wks to fix

    File Issue.php has 5330 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

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

      File UnionType.php has 3895 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

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

        File ConstantDocumentationMap.php has 3697 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        Severity: Major
        Found in src/Phan/Language/Internal/ConstantDocumentationMap.php - About 1 wk to fix

          File PostOrderAnalysisVisitor.php has 3473 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          declare(strict_types=1);
          
          namespace Phan\Analysis;
          Severity: Major
          Found in src/Phan/Analysis/PostOrderAnalysisVisitor.php - About 1 wk to fix

            File UnionTypeVisitor.php has 2798 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            declare(strict_types=1);
            
            namespace Phan\AST;
            Severity: Major
            Found in src/Phan/AST/UnionTypeVisitor.php - About 1 wk to fix

              File TolerantASTConverter.php has 2622 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              declare(strict_types=1);
              
              namespace Phan\AST\TolerantASTConverter;
              Severity: Major
              Found in src/Phan/AST/TolerantASTConverter/TolerantASTConverter.php - About 1 wk to fix

                File Type.php has 2507 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

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

                  File Clazz.php has 2467 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

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

                    File CLI.php has 2193 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

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

                      UnionType has 279 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class UnionType implements Serializable
                      {
                          /**
                           * @var string
                           * A list of one or more types delimited by the '|'
                      Severity: Major
                      Found in src/Phan/Language/UnionType.php - About 5 days to fix

                        File BlockAnalysisVisitor.php has 2010 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        Severity: Major
                        Found in src/Phan/BlockAnalysisVisitor.php - About 5 days to fix

                          File ContextNode.php has 1912 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

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

                            Method initHandleMap has 1041 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected static function initHandleMap(): array
                                {
                                    $closures = [
                                        /** @return ?ast\Node */
                                        'Microsoft\PhpParser\Node\SourceFileNode' => static function (PhpParser\Node\SourceFileNode $n, int $start_line): ?\ast\Node {
                            Severity: Major
                            Found in src/Phan/AST/TolerantASTConverter/TolerantASTConverter.php - About 5 days to fix

                              Function __construct has a Cognitive Complexity of 210 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  private function __construct(array $opts, array $argv)
                                  {
                                      self::detectAndConfigureColorSupport($opts);
                              
                                      if (\array_key_exists('extended-help', $opts)) {
                              Severity: Minor
                              Found in src/Phan/CLI.php - About 4 days to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

                              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 AssignmentVisitor.php has 1400 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

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

                                  Function initHandleMap has a Cognitive Complexity of 180 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      protected static function initHandleMap(): array
                                      {
                                          $closures = [
                                              /** @return ?ast\Node */
                                              'Microsoft\PhpParser\Node\SourceFileNode' => static function (PhpParser\Node\SourceFileNode $n, int $start_line): ?\ast\Node {
                                  Severity: Minor
                                  Found in src/Phan/AST/TolerantASTConverter/TolerantASTConverter.php - About 3 days to fix

                                  Cognitive Complexity

                                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                  A method's cognitive complexity is based on a few simple rules:

                                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                  • Code is considered more complex for each "break in the linear flow of the code"
                                  • Code is considered more complex when "flow breaking structures are nested"

                                  Further reading

                                  File CodeBase.php has 1377 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

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

                                    Method getAnalyzeFunctionCallClosuresStatic has 714 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        private static function getAnalyzeFunctionCallClosuresStatic(): array
                                        {
                                            $stop_exception = new StopParamAnalysisException();
                                    
                                            /**
                                    Severity: Major
                                    Found in src/Phan/Plugin/Internal/MiscParamPlugin.php - About 3 days to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language