Showing 3,272 of 4,939 total issues

Method canCastToUnionTypeWithoutConfig has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function canCastToUnionTypeWithoutConfig(
        UnionType $target
    ): bool {
        // Fast-track most common cases first
        $type_set = $this->type_set;
Severity: Minor
Found in src/Phan/Language/UnionType.php - About 1 hr to fix

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

        private static function getAnalyzeFunctionCallClosuresStatic(): array
        {
            /**
             * @param list<Node|int|float|string> $args
             */
    Severity: Minor
    Found in src/Phan/Plugin/Internal/CompactPlugin.php - About 1 hr to fix

      Method analyzeValueNodeOfShapedArray has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function analyzeValueNodeOfShapedArray(
              UnionType $element_type,
              $value_node
          ): void {
              if (!$value_node instanceof Node) {
      Severity: Minor
      Found in src/Phan/Analysis/AssignmentVisitor.php - About 1 hr to fix

        Method findAlternateReferencedElementDeclaration has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function findAlternateReferencedElementDeclaration(
                CodeBase $code_base,
                AddressableElement $element
            ): ?AddressableElement {
                $old_fqsen = $element->getFQSEN();
        Severity: Minor
        Found in src/Phan/Analysis/ReferenceCountsAnalyzer.php - About 1 hr to fix

          Method addTypesToProperty has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function addTypesToProperty(Property $property, Node $node): void
              {
                  if ($property->getRealUnionType()->isEmpty() && $property->getPHPDocUnionType()->isEmpty()) {
                      $property->setUnionType(
                          $this->right_type
          Severity: Minor
          Found in src/Phan/Analysis/AssignmentVisitor.php - About 1 hr to fix

            Method mergeCatchContext has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function mergeCatchContext(Node $node): Context
                {
                    if (\count($this->child_context_list) < 2) {
                        throw new AssertionError("Expected at least two contexts in " . __METHOD__);
                    }
            Severity: Minor
            Found in src/Phan/Analysis/ContextMergeVisitor.php - About 1 hr to fix

              Method analyzeReturnStrict has 45 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function analyzeReturnStrict(
                      CodeBase $code_base,
                      FunctionInterface $method,
                      UnionType $expression_type,
                      UnionType $method_return_type,
              Severity: Minor
              Found in src/Phan/Analysis/PostOrderAnalysisVisitor.php - About 1 hr to fix

                Method checkUnionTypeCompatibility has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function checkUnionTypeCompatibility(?Node $type): void
                    {
                        if (!$type) {
                            return;
                        }
                Severity: Minor
                Found in src/Phan/Analysis/PostOrderAnalysisVisitor.php - About 1 hr to fix

                  Method checkIsValidStringOffset has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function checkIsValidStringOffset(UnionType $union_type, Node $node, UnionType $dim_type): void
                      {
                          $max_len = -1;
                          foreach ($union_type->getRealTypeSet() as $type) {
                              if ($type instanceof StringType) {
                  Severity: Minor
                  Found in src/Phan/AST/UnionTypeVisitor.php - About 1 hr to fix

                    Method visitUnaryOp has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

                      Method make has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function make(
                              string $namespace,
                              string $name,
                              int $alternate_id = 0
                          ) {
                      Severity: Minor
                      Found in src/Phan/Language/FQSEN/FullyQualifiedGlobalStructuralElement.php - About 1 hr to fix

                        Method asScalarValues has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function asScalarValues(bool $strict = false): ?array
                            {
                                $result = [];
                                $has_null = false;
                                $has_false = false;
                        Severity: Minor
                        Found in src/Phan/Language/UnionType.php - About 1 hr to fix

                          Method parseListTypeFromTemplateParameterList has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private static function parseListTypeFromTemplateParameterList(
                                  array $template_parameter_type_list,
                                  bool $is_nullable,
                                  bool $always_has_elements
                              ): ArrayType {
                          Severity: Minor
                          Found in src/Phan/Language/Type.php - About 1 hr to fix

                            Method computeExpandedTypes has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function computeExpandedTypes(CodeBase $code_base, int $recursion_depth): UnionType
                                {
                                    $union_type = $this->asPHPDocUnionType();
                            
                                    $class_fqsen = $this->asFQSEN();
                            Severity: Minor
                            Found in src/Phan/Language/Type.php - About 1 hr to fix

                              Method phan_output_ast_installation_instructions has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function phan_output_ast_installation_instructions(): void
                              {
                                  require_once __DIR__ . '/Library/StringUtil.php';
                                  $ini_path = php_ini_loaded_file() ?: '(php.ini path could not be determined - try creating one at ' . dirname(PHP_BINARY) . '\\php.ini as a new empty file, or one based on php.ini.development or php.ini.production)';
                                  $configured_extension_dir = ini_get('extension_dir');
                              Severity: Minor
                              Found in src/Phan/Bootstrap.php - About 1 hr to fix

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

                                    private static function getAnalyzeFunctionCallClosuresStatic(): array
                                    {
                                        /**
                                         * @param list<Node|int|string|float> $args
                                         */
                                Severity: Minor
                                Found in src/Phan/Plugin/Internal/ClosureReturnTypeOverridePlugin.php - About 1 hr to fix

                                  Method emitIssueForBinaryOp has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function emitIssueForBinaryOp(
                                          Node $node,
                                          UnionType $left,
                                          UnionType $right,
                                          string $issue_name,
                                  Severity: Minor
                                  Found in src/Phan/Plugin/Internal/RedundantConditionVisitor.php - About 1 hr to fix

                                    Method visitIsset has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function visitIsset(Node $node): void
                                        {
                                            $var_node = $node->children['var'];
                                            try {
                                                $type = UnionTypeVisitor::unionTypeFromNode($this->code_base, $this->context, $var_node, false);
                                    Severity: Minor
                                    Found in src/Phan/Plugin/Internal/RedundantConditionVisitor.php - About 1 hr to fix

                                      Method calculateNarrowedUnionType has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          private static function calculateNarrowedUnionType(CodeBase $code_base, Context $context, UnionType $old_type, UnionType $asserted_object_type): UnionType
                                          {
                                              $new_type_set = [];
                                              foreach ($old_type->getTypeSet() as $type) {
                                                  if ($type instanceof MixedType) {
                                      Severity: Minor
                                      Found in src/Phan/Analysis/ConditionVisitor.php - About 1 hr to fix

                                        Method compareYieldAgainstDeclaredType has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            private function compareYieldAgainstDeclaredType(Node $node, FunctionInterface $method, Context $context, array $template_type_list): Context
                                            {
                                                $code_base = $this->code_base;
                                        
                                                $type_list_count = \count($template_type_list);
                                        Severity: Minor
                                        Found in src/Phan/Analysis/PostOrderAnalysisVisitor.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language