Showing 3,272 of 4,939 total issues

Method visitDoWhile has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function visitDoWhile(Node $node): Context
    {
        $context = $this->context;
        $context->setLineNumberStart($node->lineno);
        $context = $context->withEnterLoop($node);
Severity: Minor
Found in src/Phan/BlockAnalysisVisitor.php - About 1 hr to fix

    Method beforeAnalyze has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function beforeAnalyze(CodeBase $code_base): void
        {
            self::addMissingNamespacesToTypes($code_base);
    
            $code_base->eagerlyLoadAllSignatures();
    Severity: Minor
    Found in src/Phan/Plugin/Internal/MethodSearcherPlugin.php - About 1 hr to fix

      Method addTypesToPropertyStandalone has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function addTypesToPropertyStandalone(
              CodeBase $code_base,
              Context $context,
              Property $property,
              UnionType $new_types
      Severity: Minor
      Found in src/Phan/Analysis/AssignmentVisitor.php - About 1 hr to fix

        Method analyzePropertyAssignmentStrict has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function analyzePropertyAssignmentStrict(Property $property, UnionType $assignment_type, Node $node): void
            {
                $type_set = $assignment_type->getTypeSet();
                if (\count($type_set) < 2) {
                    throw new AssertionError('Expected to have at least two types when checking if types match in strict mode');
        Severity: Minor
        Found in src/Phan/Analysis/AssignmentVisitor.php - About 1 hr to fix

          Method visit has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function visit(Node $node): UnionType
              {
                  $left = UnionTypeVisitor::unionTypeFromNode(
                      $this->code_base,
                      $this->context,
          Severity: Minor
          Found in src/Phan/Analysis/BinaryOperatorFlagVisitor.php - About 1 hr to fix

            Method checkComplexNegatedEmpty has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function checkComplexNegatedEmpty(Node $var_node): Context
                {
                    $context = $this->context;
                    // TODO: !empty($obj->prop['offset']) should imply $obj is not null (removeNullFromVariable)
                    if ($var_node->kind === ast\AST_DIM) {
            Severity: Minor
            Found in src/Phan/Analysis/NegatedConditionVisitor.php - About 1 hr to fix

              Method visitPrint has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function visitPrint(Node $node): Context
                  {
                      $code_base = $this->code_base;
                      $context = $this->context;
                      $expr_node = $node->children['expr'];
              Severity: Minor
              Found in src/Phan/Analysis/PostOrderAnalysisVisitor.php - About 1 hr to fix

                Method getVariableName has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getVariableName(): string
                    {
                        if (!($this->node instanceof Node)) {
                            return (string)$this->node;
                        }
                Severity: Minor
                Found in src/Phan/AST/ContextNode.php - About 1 hr to fix

                  Method functionLikeListFromNodeAndContext has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function functionLikeListFromNodeAndContext(CodeBase $code_base, Context $context, $node, bool $log_error): array
                      {
                          try {
                              $function_fqsens = (new UnionTypeVisitor($code_base, $context, true))->functionLikeFQSENListFromNode($node);
                          } catch (FQSENException $e) {
                  Severity: Minor
                  Found in src/Phan/AST/UnionTypeVisitor.php - About 1 hr to fix

                    Method getAvailableConstantPHPDocSummaries has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function getAvailableConstantPHPDocSummaries(): array
                        {
                            return $this->memoize(__METHOD__, /** @return array<string,string> */ function (): array {
                                $code_base = $this->code_base;
                                $map = [];
                    Severity: Minor
                    Found in internal/lib/IncompatibleRealStubsSignatureDetector.php - About 1 hr to fix

                      Method analyzeTemporaryDirectory has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private static function analyzeTemporaryDirectory(int $i, array $new_tokens_for_files)
                          {
                              $tmp_dir = self::$basename . "/tmp/mutate$i";
                              mkdir("$tmp_dir/.phan", 0766, true);
                              mkdir("$tmp_dir/src", 0766, true);
                      Severity: Minor
                      Found in internal/fuzz_test.php - About 1 hr to fix

                        Method arrayTypeFromFlags has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private static function arrayTypeFromFlags(array $flag_set): UnionType
                            {
                                // 1. Convert key types from opcache to Phan's representation
                                if (isset($flag_set['MAY_BE_ARRAY_KEY_ANY'])) {
                                    $key_type = GenericArrayType::KEY_MIXED;
                        Severity: Minor
                        Found in internal/extract_arg_info.php - About 1 hr to fix

                          Method getAvailableConstantPHPDocSummaries has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function getAvailableConstantPHPDocSummaries(): array
                              {
                                  return $this->memoize(__METHOD__, /** @return array<string,string> */ function (): array {
                                      $code_base = $this->code_base;
                                      $map = [];
                          Severity: Minor
                          Found in internal/lib/IncompatibleStubsSignatureDetector.php - About 1 hr to fix

                            Method visitIf has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function visitIf(Node $node): void
                                {
                                    if (count($node->children) <= 1) {
                                        // There can't be any duplicates.
                                        return;
                            Severity: Minor
                            Found in .phan/plugins/DuplicateExpressionPlugin.php - About 1 hr to fix

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

                                  public function visitConditional(Node $node): void
                                  {
                                      $cond_node = $node->children['cond'];
                                      $true_node_hash = ASTHasher::hash($node->children['true']);
                              
                              
                              Severity: Minor
                              Found in .phan/plugins/DuplicateExpressionPlugin.php - About 1 hr to fix

                                Method toStubInfo has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function toStubInfo(CodeBase $code_base): array
                                    {
                                        $signature = $this->toStubSignature($code_base);
                                
                                        $stub = $signature;
                                Severity: Minor
                                Found in src/Phan/Language/Element/Clazz.php - About 1 hr to fix

                                  Method locateNamespaceUseDefinition has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public static function locateNamespaceUseDefinition(GoToDefinitionRequest $request, CodeBase $code_base, Node $node): void
                                      {
                                          // TODO: Support GroupUse (See ScopeVisitor->visitGroupUse)
                                          $targets = ScopeVisitor::aliasTargetMapFromUseNode($node);
                                          if (count($targets) !== 1) {
                                  Severity: Minor
                                  Found in src/Phan/LanguageServer/DefinitionResolver.php - About 1 hr to fix

                                    Method getNamespaceMapFor has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function getNamespaceMapFor(
                                            int $flags,
                                            string $name
                                        ): FullyQualifiedGlobalStructuralElement {
                                    
                                    
                                    Severity: Minor
                                    Found in src/Phan/Language/Context.php - About 1 hr to fix

                                      Method visitStaticCall has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function visitStaticCall(Node $node): void
                                          {
                                              [$parent, $used] = $this->findNonUnaryParentNode($node);
                                              if (!$parent) {
                                                  //fwrite(STDERR, "No parent in " . __METHOD__ . "\n");

                                        Method wrapNArgumentFunction has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public static function wrapNArgumentFunction(
                                                string $function_name,
                                                int $min_args,
                                                ?int $max_args = null
                                            ): Closure {
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language