Showing 3,272 of 4,939 total issues

Method canCastToDeclaredType has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function canCastToDeclaredType(CodeBase $code_base, Context $context, Type $type): bool
    {
        if ($type instanceof ScalarType) {
            switch ($type::NAME) {
                case 'string':
Severity: Minor
Found in src/Phan/Language/Type/LiteralStringType.php - About 1 hr to fix

    Method asGeneratorTemplateType has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function asGeneratorTemplateType(): Type
        {
            $fallback_values = UnionType::empty();
            $fallback_keys = UnionType::empty();
    
    
    Severity: Minor
    Found in src/Phan/Language/UnionType.php - About 1 hr to fix

      Method canCastToType has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function canCastToType(Type $type): bool
          {
              // Check to see if we have an exact object match
              if ($this === $type) {
                  return true;
      Severity: Minor
      Found in src/Phan/Language/Type.php - About 1 hr to fix

        Method getTemplateTypeExtractorClosure has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getTemplateTypeExtractorClosure(CodeBase $code_base, TemplateType $template_type): ?Closure
            {
                if (!$this->template_parameter_type_list) {
                    return null;
                }
        Severity: Minor
        Found in src/Phan/Language/Type.php - About 1 hr to fix

          Method closureParamComponentStringsToParams has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private static function closureParamComponentStringsToParams(array $param_components, Context $context, int $source): array
              {
                  $result = [];
                  foreach ($param_components as $param_string) {
                      if ($param_string === '') {
          Severity: Minor
          Found in src/Phan/Language/Type.php - About 1 hr to fix

            Method suggestSimilarClassPropertiesToGlobalConstant has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private static function suggestSimilarClassPropertiesToGlobalConstant(CodeBase $code_base, Context $context, FullyQualifiedGlobalConstantName $fqsen): array
                {
                    if (!$context->isInClassScope()) {
                        return [];
                    }
            Severity: Minor
            Found in src/Phan/IssueFixSuggester.php - About 1 hr to fix

              Method createClosures has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private static function createClosures(): array
                  {
                      /**
                       * @return ?FileEditSet
                       */
              Severity: Minor
              Found in src/Phan/Plugin/Internal/IssueFixingPlugin/IssueFixer.php - About 1 hr to fix

                Method matchesParamTypes has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function matchesParamTypes(CodeBase $code_base, array $search_param_types, array $signature_param_types): float
                    {
                        if (\count($search_param_types) === 0) {
                            // Award extra points for having the same number of matches
                            return \max(1, 5 - count($signature_param_types)) / 2;
                Severity: Minor
                Found in src/Phan/Plugin/Internal/MethodSearcherPlugin.php - About 1 hr to fix

                  Method initialize has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private static function initialize(): void
                      {
                  
                          // Create a shutdown function to emit the log when we're
                          // all done
                  Severity: Minor
                  Found in src/Phan/Profile.php - About 1 hr to fix

                    Method analyzeAssignmentTarget has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function analyzeAssignmentTarget($node, bool $is_ref, $const_expr): VariableTrackingScope
                        {
                            // TODO: Push onto the node list?
                            if (!($node instanceof Node)) {
                                return $this->scope;
                    Severity: Minor
                    Found in src/Phan/Plugin/Internal/VariableTracker/VariableTrackerVisitor.php - About 1 hr to fix

                      Method visitCall has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function visitCall(Node $node): Context
                          {
                              // If this is a call to a method that indicates that we
                              // are treating the method in scope as a varargs method,
                              // then set its optional args to something very high so
                      Severity: Minor
                      Found in src/Phan/Parse/ParseVisitor.php - About 1 hr to fix

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

                            public function visitBinaryOp(Node $node): Context
                            {
                                $flags = $node->flags;
                                switch ($flags) {
                                    case flags\BINARY_BOOL_AND:
                        Severity: Minor
                        Found in src/Phan/Analysis/ConditionVisitor.php - About 1 hr to fix

                          Method setReturnTypeOfGenerator has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private function setReturnTypeOfGenerator(FunctionInterface $func, Node $node): void
                              {
                                  // Currently, there is no way to describe the types passed to
                                  // a Generator in phpdoc.
                                  // So, nothing bothers recording the types beyond \Generator.
                          Severity: Minor
                          Found in src/Phan/Analysis/PreOrderAnalysisVisitor.php - About 1 hr to fix

                            Method analyzeDefine has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function analyzeDefine(Node $node): void
                                {
                                    $args = $node->children['args'];
                                    if (\count($args->children) < 2) {
                                        return;
                            Severity: Minor
                            Found in src/Phan/Parse/ParseVisitor.php - About 1 hr to fix

                              Method analyzeRemainingParametersForVariadic has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private static function analyzeRemainingParametersForVariadic(
                                      CodeBase $code_base,
                                      Context $context,
                                      FunctionInterface $method,
                                      int $start_index,
                              Severity: Minor
                              Found in src/Phan/Analysis/ArgumentType.php - About 1 hr to fix

                                Method isAssignmentOrNestedAssignmentOrModification has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    private function isAssignmentOrNestedAssignmentOrModification(Node $node): ?bool
                                    {
                                        $parent_node_list = $this->parent_node_list;
                                        $parent_node = \end($parent_node_list);
                                        if (!$parent_node instanceof Node) {
                                Severity: Minor
                                Found in src/Phan/Analysis/PostOrderAnalysisVisitor.php - About 1 hr to fix

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

                                      public function visitUnaryOp(Node $node): Context
                                      {
                                          if ($node->flags === flags\UNARY_SILENCE) {
                                              $expr = $node->children['expr'];
                                              if ($expr instanceof Node) {
                                  Severity: Minor
                                  Found in src/Phan/Analysis/PostOrderAnalysisVisitor.php - About 1 hr to fix

                                    Method astNodeBinaryop has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        private static function astNodeBinaryop(int $flags, PhpParser\Node\Expression\BinaryExpression $n, int $start_line)
                                        {
                                            try {
                                                $left_node = static::phpParserNodeToAstNode($n->leftOperand);
                                            } catch (InvalidNodeException $_) {
                                    Severity: Minor
                                    Found in src/Phan/AST/TolerantASTConverter/TolerantASTConverter.php - About 1 hr to fix

                                      Method typeAfterCastToObject has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          private static function typeAfterCastToObject(UnionType $expr_type): UnionType
                                          {
                                              static $stdclass;
                                              if ($stdclass === null) {
                                                  $stdclass = Type::fromFullyQualifiedString('\stdClass');
                                      Severity: Minor
                                      Found in src/Phan/AST/UnionTypeVisitor.php - About 1 hr to fix

                                        Method extractInfoFromReflection has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            private static function extractInfoFromReflection(): array
                                            {
                                                $result = [];
                                                $function_names = get_defined_functions();
                                                unset($function_names['user']);
                                        Severity: Minor
                                        Found in internal/extract_arg_info.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language