Showing 3,272 of 4,939 total issues

Method addClosuresForBeforeLoopBodyAnalysisCapability has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private static function addClosuresForBeforeLoopBodyAnalysisCapability(
        ClosuresForKind $closures_for_kind,
        BeforeLoopBodyAnalysisCapability $plugin
    ): void {
        $plugin_analysis_class = $plugin->getBeforeLoopBodyAnalysisVisitorClassName();
Severity: Minor
Found in src/Phan/Plugin/ConfigPluginSet.php - About 1 hr to fix

    Method checkExpressionInDynamicString has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function checkExpressionInDynamicString(Node $expr_node): void
        {
            $code_base = $this->code_base;
            $context = $this->context;
            $type = UnionTypeVisitor::unionTypeFromNode(
    Severity: Minor
    Found in src/Phan/Analysis/PostOrderAnalysisVisitor.php - About 1 hr to fix

      Method testClassAccess has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private static function testClassAccess(
              Clazz $source_class,
              Clazz $target_class,
              CodeBase $code_base
          ): void {
      Severity: Minor
      Found in src/Phan/Analysis/ClassInheritanceAnalyzer.php - About 1 hr to fix

        Method visitMethod has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function visitMethod(Node $node): Context
            {
                if (!$this->context->isInFunctionLikeScope()) {
                    throw new AssertionError("Must be in function-like scope to get method");
                }
        Severity: Minor
        Found in src/Phan/Analysis/PostOrderAnalysisVisitor.php - About 1 hr to fix

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

              public function visitConditional(Node $node): UnionType
              {
                  $cond_node = $node->children['cond'];
                  $cond_truthiness = UnionTypeVisitor::checkCondUnconditionalTruthiness($cond_node);
                  // For the shorthand $a ?: $b, the cond node will be the truthy value.
          Severity: Minor
          Found in src/Phan/AST/FallbackUnionTypeVisitor.php - About 1 hr to fix

            Method findNodeAtOffsetRecursive has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private static function findNodeAtOffsetRecursive(\Microsoft\PhpParser\Node $parser_node, int $offset)
                {
                    foreach ($parser_node->getChildNodesAndTokens() as $key => $node_or_token) {
                        if ($node_or_token instanceof Token) {
                            // fprintf(

              Method createArrayShapeType has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function createArrayShapeType(array $key_set): ArrayShapeType
                  {
                      $field_types = [];
              
                      foreach ($key_set as $key => $child) {
              Severity: Minor
              Found in src/Phan/AST/UnionTypeVisitor.php - About 1 hr to fix

                Method getClassXMLFiles has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function getClassXMLFiles(): array
                    {
                        return $this->memoize(__METHOD__, /** @return array<string,SimpleXMLElement> */ function (): array {
                            $remaining_folders = [
                                $this->reference_directory,
                Severity: Minor
                Found in internal/lib/IncompatibleXMLSignatureDetector.php - About 1 hr to fix

                  Method getAvailableMethodPHPDocSummaries has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

                    Method getAvailableMethodPHPDocSummaries has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

                      Method warnInvalidArgumentType has 11 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              CodeBase $code_base,
                              Context $context,
                              FunctionInterface $method,
                              Parameter $alternate_parameter,
                              UnionType $alternate_parameter_type,
                      Severity: Major
                      Found in src/Phan/Analysis/ArgumentType.php - About 1 hr to fix

                        Method inheritConstant has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function inheritConstant(
                                CodeBase $code_base,
                                ClassConstant $constant
                            ): void {
                                $constant_fqsen = FullyQualifiedClassConstantName::make(
                        Severity: Minor
                        Found in src/Phan/Language/Element/Clazz.php - About 1 hr to fix

                          Method finishAnalyzingURIsWithoutPcntl has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private function finishAnalyzingURIsWithoutPcntl(array $uris_to_analyze): void
                              {
                                  $paths_to_analyze = \array_keys($uris_to_analyze);
                                  Logger::logInfo('in ' . __METHOD__ . ' paths: ' . StringUtil::jsonEncode($paths_to_analyze));
                                  // When there is no pcntl:
                          Severity: Minor
                          Found in src/Phan/LanguageServer/LanguageServer.php - About 1 hr to fix

                            Method hydrateConstantsOnce has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected function hydrateConstantsOnce(CodeBase $code_base): void
                                {
                                    foreach ($this->getAncestorFQSENList() as $fqsen) {
                                        if ($code_base->hasClassWithFQSEN($fqsen)) {
                                            $code_base->getClassByFQSENWithoutHydrating(
                            Severity: Minor
                            Found in src/Phan/Language/Element/Clazz.php - About 1 hr to fix

                              Method extractParamTagsFromDocComment has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public static function extractParamTagsFromDocComment(AddressableElementInterface $element, bool $with_param_details = true): array
                                  {
                                      $doc_comment = $element->getDocComment();
                                      if (!\is_string($doc_comment)) {
                                          return [];
                              Severity: Minor
                              Found in src/Phan/Language/Element/MarkupDescription.php - About 1 hr to fix

                                Method canCastToNonNullableType has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    protected function canCastToNonNullableType(Type $type): bool
                                    {
                                        if ($type instanceof ScalarType) {
                                            switch ($type::NAME) {
                                                case 'float':
                                Severity: Minor
                                Found in src/Phan/Language/Type/LiteralFloatType.php - About 1 hr to fix

                                  Method extractNameList has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      private static function extractNameList(string $list_string): array
                                      {
                                          $results = [];
                                          $prev_parts = [];
                                          $delta = 0;
                                  Severity: Minor
                                  Found in src/Phan/Language/Type.php - About 1 hr to fix

                                    Method suggestSimilarClassConstant has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public static function suggestSimilarClassConstant(CodeBase $code_base, Context $context, FullyQualifiedClassConstantName $class_constant_fqsen): ?Suggestion
                                        {
                                            if (Config::getValue('disable_suggestions')) {
                                                return null;
                                            }
                                    Severity: Minor
                                    Found in src/Phan/IssueFixSuggester.php - About 1 hr to fix

                                      Method findNonUnaryParentNode has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          private function findNonUnaryParentNode(Node $node): array
                                          {
                                              $parent = \end($this->parent_node_list);
                                              if (!$parent) {
                                                  return [null, true];

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

                                            private static function getAnalyzeFunctionCallClosuresStatic(CodeBase $code_base): array
                                            {
                                                $result = [];
                                                $add_callable_checker_closure = static function (FunctionInterface $function) use (&$result): void {
                                                    // Generate a de-duplicated closure.
                                        Severity: Minor
                                        Found in src/Phan/Plugin/Internal/CallableParamPlugin.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language