Showing 3,272 of 4,939 total issues

Method adaptInheritedMethodFromTrait has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function adaptInheritedMethodFromTrait(Method $method): Method
    {
        $method_flags = $method->getFlags();
        if (Flags::bitVectorHasState($method_flags, \ast\flags\MODIFIER_PRIVATE)) {
            $method = $method->createUseAlias($this, $method->getName(), \ast\flags\MODIFIER_PRIVATE);
Severity: Major
Found in src/Phan/Language/Element/Clazz.php - About 2 hrs to fix

    Method typeStringComponentsInner has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private static function typeStringComponentsInner(
            string $type_string
        ): Tuple5 {
            // Check to see if we have template parameter types
            $template_parameter_type_name_list = [];
    Severity: Major
    Found in src/Phan/Language/Type.php - About 2 hrs to fix

      Method visitConditional has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function visitConditional(Node $node): Context
          {
              $context = $this->context->withLineNumberStart(
                  $node->lineno
              );
      Severity: Major
      Found in src/Phan/BlockAnalysisVisitor.php - About 2 hrs to fix

        Method analyzeSubstituteVarAssert has 52 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function analyzeSubstituteVarAssert(CodeBase $code_base, Context $context, string $text): void
            {
                $has_known_annotations = false;
                if (\preg_match_all(self::PHAN_VAR_REGEX, $text, $matches, \PREG_SET_ORDER) > 0) {
                    $has_known_annotations = true;
        Severity: Major
        Found in src/Phan/BlockAnalysisVisitor.php - About 2 hrs to fix

          Method visitTry has 52 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function visitTry(Node $node): Context
              {
                  $context = $this->context->withLineNumberStart(
                      $node->lineno
                  );
          Severity: Major
          Found in src/Phan/BlockAnalysisVisitor.php - About 2 hrs to fix

            Method phan_error_handler has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function phan_error_handler(int $errno, string $errstr, string $errfile, int $errline): bool
            {
                global $__no_echo_phan_errors;
                if ($__no_echo_phan_errors) {
                    if ($__no_echo_phan_errors instanceof Closure) {
            Severity: Major
            Found in src/Phan/Bootstrap.php - About 2 hrs to fix

              Method print has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function print(IssueInstance $instance): void
                  {
                      $file    = $instance->getDisplayedFile();
                      $line    = $instance->getLine();
                      $issue   = $instance->getIssue();
              Severity: Major
              Found in src/Phan/Output/Printer/PlainTextPrinter.php - About 2 hrs to fix

                Method checkRedundantOrImpossibleTruthyCondition has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function checkRedundantOrImpossibleTruthyCondition($node, Context $context, ?UnionType $type, bool $is_negated): void
                    {
                        if ($node instanceof Node) {
                            // Here, we only perform the redundant condition checks on whichever ran first, to avoid warning about both impossible and redundant conditions
                            if (isset($node->did_check_redundant_condition)) {
                Severity: Major
                Found in src/Phan/Analysis/ConditionVisitorUtil.php - About 2 hrs to fix

                  Method extractDocComment has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function extractDocComment(string $doc_comment, int $comment_category = null, UnionType $element_type = null, bool $remove_type = false): string
                      {
                          // Trim the start and the end of the doc comment.
                          //
                          // We leave in the second `*` of `/**` so that every single non-empty line
                  Severity: Major
                  Found in src/Phan/Language/Element/MarkupDescription.php - About 2 hrs to fix

                    Method analyzeBinaryCoalesceForRedundantCondition has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function analyzeBinaryCoalesceForRedundantCondition(Context $context, Node $node): void
                        {
                            $left_node = $node->children['left'];
                            $right_node = $node->children['right'];
                            // @phan-suppress-next-line PhanPartialTypeMismatchArgumentInternal, PhanPossiblyUndeclaredProperty
                    Severity: Major
                    Found in src/Phan/BlockAnalysisVisitor.php - About 2 hrs to fix

                      Method visitBinaryOp has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function visitBinaryOp(Node $node): void
                          {
                              $flags = $node->flags;
                              if (!\array_key_exists($flags, self::REDUNDANT_BINARY_OP_SET)) {
                                  // Nothing to warn about
                      Severity: Major
                      Found in .phan/plugins/DuplicateExpressionPlugin.php - About 2 hrs to fix

                        Method isRedundantFunctionComment has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private static function isRedundantFunctionComment(FunctionInterface $method, string $doc_comment): bool
                            {
                                $lines = explode("\n", $doc_comment);
                                foreach ($lines as $line) {
                                    $line = trim($line, " \r\n\t*/");
                        Severity: Major
                        Found in .phan/plugins/PHPDocRedundantPlugin.php - About 2 hrs to fix

                          File extract_arg_info.php has 251 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          #!/usr/bin/env php
                          <?php
                          
                          declare(strict_types=1);
                          
                          
                          Severity: Minor
                          Found in internal/extract_arg_info.php - About 2 hrs to fix

                            Method getShortRepresentationForIssue has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function getShortRepresentationForIssue(bool $is_internal = false): string
                                {
                                    $string = '';
                            
                                    $union_type_string = $this->getUnionTypeRepresentationForIssue();
                            Severity: Minor
                            Found in src/Phan/Language/Element/Parameter.php - About 2 hrs to fix

                              Method suggestVariableTypoFix has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public static function suggestVariableTypoFix(CodeBase $code_base, Context $context, string $variable_name, string $prefix = 'Did you mean'): ?Suggestion
                                  {
                                      if (Config::getValue('disable_suggestions')) {
                                          return null;
                                      }
                              Severity: Minor
                              Found in src/Phan/IssueFixSuggester.php - About 2 hrs to fix

                                Method checkCanIterate has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    private function checkCanIterate(UnionType $union_type, Node $node): void
                                    {
                                        if ($union_type->isEmpty()) {
                                            return;
                                        }
                                Severity: Minor
                                Found in src/Phan/BlockAnalysisVisitor.php - About 2 hrs to fix

                                  Method visitInstanceof has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function visitInstanceof(Node $node): void
                                      {
                                          $expr_node = $node->children['expr'];
                                          $code_base = $this->code_base;
                                          try {
                                  Severity: Minor
                                  Found in src/Phan/Plugin/Internal/RedundantConditionVisitor.php - About 2 hrs to fix

                                    Method visitStaticProp has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function visitStaticProp(Node $node): Context
                                        {
                                            $property_name = $node->children['prop'];
                                    
                                            // Things like self::${$x}
                                    Severity: Minor
                                    Found in src/Phan/Analysis/AssignmentVisitor.php - About 2 hrs to fix

                                      Method computeTypeSetOfMergedArrayShapeTypes has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          private static function computeTypeSetOfMergedArrayShapeTypes(array $old_type_set, array $new_type_set, int $dim_depth, bool $is_real): array
                                          {
                                              if ($is_real) {
                                                  if (!$old_type_set || !$new_type_set) {
                                                      return [];
                                      Severity: Minor
                                      Found in src/Phan/Analysis/AssignmentVisitor.php - About 2 hrs to fix

                                        Method visitFuncDecl has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function visitFuncDecl(Node $node): Context
                                            {
                                                $function_name = (string)$node->children['name'];
                                                $code_base = $this->code_base;
                                                $original_context = $this->context;
                                        Severity: Minor
                                        Found in src/Phan/Analysis/PreOrderAnalysisVisitor.php - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language