Showing 3,272 of 4,939 total issues

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

    public function visitMethod(Node $node): Context
    {
        $method_name = (string)$node->children['name'];
        $code_base = $this->code_base;
        $context = $this->context;
Severity: Major
Found in src/Phan/Analysis/PreOrderAnalysisVisitor.php - About 2 hrs to fix

    Method analyzePropertyTypes has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function analyzePropertyTypes(CodeBase $code_base, Clazz $clazz): void
        {
            foreach ($clazz->getPropertyMap($code_base) as $property) {
                // This phase is done before the analysis phase, so there aren't any dynamic properties to filter out.
    
    
    Severity: Major
    Found in src/Phan/Analysis/PropertyTypesAnalyzer.php - About 2 hrs to fix

      Method emitTypeMismatchReturnIssue has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function emitTypeMismatchReturnIssue(UnionType $expression_type, FunctionInterface $method, UnionType $method_return_type, int $lineno, $inner_node): void
          {
              if ($this->shouldSuppressIssue(Issue::TypeMismatchReturnReal, $lineno)) {
                  // Suppressing TypeMismatchReturnReal also suppresses less severe return type mismatches
                  return;
      Severity: Major
      Found in src/Phan/Analysis/PostOrderAnalysisVisitor.php - About 2 hrs to fix

        Method visitMethodCall has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function visitMethodCall(Node $node): Context
            {
                $method_name = $node->children['method'];
        
                if (!\is_string($method_name)) {
        Severity: Major
        Found in src/Phan/Analysis/PostOrderAnalysisVisitor.php - About 2 hrs to fix

          Method methodListFromReflectionClassAndMethod has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function methodListFromReflectionClassAndMethod(
                  Context $context,
                  \ReflectionClass $class,
                  \ReflectionMethod $reflection_method
              ): array {
          Severity: Major
          Found in src/Phan/Language/Element/FunctionFactory.php - About 2 hrs to fix

            Method asFunctionInterfaceOrNull has 55 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function asFunctionInterfaceOrNull(CodeBase $code_base, Context $context): ?FunctionInterface
                {
                    if (\count($this->field_types) !== 2) {
                        Issue::maybeEmit(
                            $code_base,
            Severity: Major
            Found in src/Phan/Language/Type/ArrayShapeType.php - About 2 hrs to fix

              Method visitPropGroup has 55 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function visitPropGroup(Node $node): Context
                  {
                      // Bomb out if we're not in a class context
                      ['props' => $props_node, 'type' => $type_node] = $node->children;
                      if (!$props_node instanceof Node) {
              Severity: Major
              Found in src/Phan/Parse/ParseVisitor.php - About 2 hrs to fix

                Method analyzeDuplicateFunction has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function analyzeDuplicateFunction(
                        CodeBase $code_base,
                        FunctionInterface $method
                    ): void {
                        $fqsen = $method->getFQSEN();
                Severity: Major
                Found in src/Phan/Analysis/DuplicateFunctionAnalyzer.php - About 2 hrs to fix

                  Method getFunction has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getFunction(
                          string $function_name,
                          bool $is_function_declaration = false,
                          bool $return_placeholder_for_undefined = false
                      ): FunctionInterface {
                  Severity: Major
                  Found in src/Phan/AST/ContextNode.php - About 2 hrs to fix

                    Method updateSignature has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function updateSignature(string $function_like_name, array $arguments_from_phan): array
                        {
                            $return_type = $arguments_from_phan[0];
                            $arguments_from_external_stub = $this->parseFunctionLikeSignature($function_like_name);
                            if (is_null($arguments_from_external_stub)) {
                    Severity: Major
                    Found in internal/lib/IncompatibleRealStubsSignatureDetector.php - About 2 hrs to fix

                      Method visitSwitchList has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function visitSwitchList(Node $node): void
                          {
                              $children = $node->children;
                              if (count($children) <= 1) {
                                  // This plugin will never emit errors if there are 0 or 1 elements.
                      Severity: Major
                      Found in .phan/plugins/DuplicateArrayKeyPlugin.php - About 2 hrs to fix

                        File ArrayType.php has 257 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

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

                          ClassElement has 21 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          abstract class ClassElement extends AddressableElement
                          {
                              /** @var FullyQualifiedClassName the FQSEN of the class this ClassElement belongs to */
                              private $class_fqsen;
                          
                          
                          Severity: Minor
                          Found in src/Phan/Language/Element/ClassElement.php - About 2 hrs to fix

                            ScalarType has 21 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            abstract class ScalarType extends NativeType
                            {
                                public function isScalar(): bool
                                {
                                    return true;
                            Severity: Minor
                            Found in src/Phan/Language/Type/ScalarType.php - About 2 hrs to fix

                              TemplateType has 21 functions (exceeds 20 allowed). Consider refactoring.
                              Open

                              final class TemplateType extends Type
                              {
                                  /** @var string an identifier for the template type. */
                                  private $template_type_identifier;
                              
                              
                              Severity: Minor
                              Found in src/Phan/Language/Type/TemplateType.php - About 2 hrs to fix

                                ArgumentType has 21 functions (exceeds 20 allowed). Consider refactoring.
                                Open

                                final class ArgumentType
                                {
                                
                                    /**
                                     * @param FunctionInterface $method
                                Severity: Minor
                                Found in src/Phan/Analysis/ArgumentType.php - About 2 hrs to fix

                                  Method getFlagSuggestionString has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public static function getFlagSuggestionString(
                                          string $key
                                      ): string {
                                          $trim = static function (string $s): string {
                                              return \rtrim($s, ':');
                                  Severity: Major
                                  Found in src/Phan/CLI.php - About 2 hrs to fix

                                    Method __construct has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function __construct(ProtocolReader $reader, ProtocolWriter $writer, CodeBase $code_base, Closure $file_path_lister)
                                        {
                                            parent::__construct($this, '/');
                                            $this->protocolReader = $reader;
                                            $this->file_mapping = new FileMapping();
                                    Severity: Major
                                    Found in src/Phan/LanguageServer/LanguageServer.php - About 2 hrs to fix

                                      Method computeExpandedTypesPreservingTemplate has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

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

                                        Method analyzeDuplicateClass has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public static function analyzeDuplicateClass(
                                                CodeBase $code_base,
                                                Clazz $clazz
                                            ): void {
                                                // Determine if it's a duplicate by looking to see if
                                        Severity: Major
                                        Found in src/Phan/Analysis/DuplicateClassAnalyzer.php - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language