Showing 3,272 of 4,939 total issues

Method analyzeUnsetDim has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function analyzeUnsetDim(Node $node): void
    {
        $expr_node = $node->children['expr'];
        if (!($expr_node instanceof Node)) {
            // php -l would warn
Severity: Minor
Found in src/Phan/Analysis/PostOrderAnalysisVisitor.php - About 1 hr to fix

    Method checkForInfiniteRecursionWithSameArgs has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function checkForInfiniteRecursionWithSameArgs(Node $node, FunctionInterface $method): void
        {
            $argument_list_node = $node->children['args'];
            $parameter_list = $method->getParameterList();
            if (\count($argument_list_node->children) !== \count($parameter_list)) {
    Severity: Minor
    Found in src/Phan/Analysis/PostOrderAnalysisVisitor.php - About 1 hr to fix

      Method visitClassName has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function visitClassName(Node $node): UnionType
          {
              $class_node = $node->children['class'];
              try {
                  $class_list = (new ContextNode(
      Severity: Minor
      Found in src/Phan/AST/UnionTypeVisitor.php - About 1 hr to fix

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

            public function __construct(string $binary, string $file_contents, Context $context)
            {
                $this->context = clone($context);
                $new_file_contents = Parser::removeShebang($file_contents);
                // TODO: Use symfony process
        Severity: Minor
        Found in .phan/plugins/InvokePHPNativeSyntaxCheckPlugin.php - About 1 hr to fix

          Method __construct has 15 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  int $comment_flags,
                  array $variable_list,
                  array $parameter_list,
                  array $template_type_list,
                  Option $inherited_type,
          Severity: Major
          Found in src/Phan/Language/Element/Comment.php - About 1 hr to fix

            Method internalFunctionSignatureMapForFQSEN has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function internalFunctionSignatureMapForFQSEN(
                    $function_fqsen
                ): array {
                    $map = self::internalFunctionSignatureMap(Config::get_closest_target_php_version_id());
            
            
            Severity: Minor
            Found in src/Phan/Language/UnionType.php - About 1 hr to fix

              Method checkPossiblyInfiniteLoopNodes has 46 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function checkPossiblyInfiniteLoopNodes(
                      VariableGraph $variable_graph,
                      VariableTrackerVisitor $variable_tracker_visitor
                  ): void {
                      $loop_nodes = $variable_tracker_visitor->getPossiblyInfiniteLoopNodes();
              Severity: Minor
              Found in src/Phan/Plugin/Internal/VariableTrackerPlugin.php - About 1 hr to fix

                Method visitThrow has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function visitThrow(Node $node): void
                    {
                        $code_base = $this->code_base;
                        $context = $this->context;
                        $union_type = UnionTypeVisitor::unionTypeFromNode($code_base, $context, $node->children['expr']);
                Severity: Minor
                Found in src/Phan/Plugin/Internal/ThrowAnalyzerPlugin.php - About 1 hr to fix

                  Method checkAbstractStaticMethodCall has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

                    Method updateTargetVariableWithType has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function updateTargetVariableWithType(Node $node, Closure $get_type): Context
                        {
                            try {
                                $variable_name = (new ContextNode(
                                    $this->code_base,
                    Severity: Minor
                    Found in src/Phan/Analysis/AssignOperatorAnalysisVisitor.php - About 1 hr to fix

                      Method modifyComplexExpression has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function modifyComplexExpression($node, Closure $type_modification_callback, Context $context, array $args): Context
                          {
                              for (;;) {
                                  if (!$node instanceof Node) {
                                      return $context;
                      Severity: Minor
                      Found in src/Phan/Analysis/ConditionVisitorUtil.php - About 1 hr to fix

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

                            public function visitMethod(Node $node): Context
                            {
                                // Bomb out if we're not in a class context
                                $class = $this->getContextClass();
                                $context = $this->context;
                        Severity: Minor
                        Found in src/Phan/Parse/ParseVisitor.php - About 1 hr to fix

                          Method updateVariableToBeCompared has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              final public function updateVariableToBeCompared(
                                  Node $var_node,
                                  $expr,
                                  int $flags
                              ): Context {
                          Severity: Minor
                          Found in src/Phan/Analysis/ConditionVisitorUtil.php - About 1 hr to fix

                            Method visitBinaryOpCommon has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function visitBinaryOpCommon(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 aliasTargetMapFromUseNode has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public static function aliasTargetMapFromUseNode(
                                      Node $node,
                                      string $prefix = '',
                                      int $flags = 0
                                  ): array {
                              Severity: Minor
                              Found in src/Phan/Analysis/ScopeVisitor.php - About 1 hr to fix

                                Method astStmtClass has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    private static function astStmtClass(
                                        int $flags,
                                        ?string $name,
                                        ?\ast\Node $extends,
                                        ?\Microsoft\PhpParser\node\classinterfaceclause $implements,
                                Severity: Minor
                                Found in src/Phan/AST/TolerantASTConverter/TolerantASTConverter.php - About 1 hr to fix

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

                                      public function addProperty(
                                          CodeBase $code_base,
                                          Property $property,
                                          Option $type_option,
                                          bool $from_trait = false
                                  Severity: Minor
                                  Found in src/Phan/Language/Element/Clazz.php - About 1 hr to fix

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

                                        public static function extractDescriptionFromDocComment(
                                            AddressableElementInterface $element,
                                            CodeBase $code_base = null
                                        ): ?string {
                                            $extracted_doc_comment = self::extractDescriptionFromDocCommentRaw($element);
                                    Severity: Minor
                                    Found in src/Phan/Language/Element/MarkupDescription.php - About 1 hr to fix

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

                                          public function asExpandedTypes(
                                              CodeBase $code_base,
                                              int $recursion_depth = 0
                                          ): UnionType {
                                              // We're going to assume that if the type hierarchy
                                      Severity: Minor
                                      Found in src/Phan/Language/Type/GenericArrayType.php - About 1 hr to fix

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

                                            public function hasSubtypeOf(
                                                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
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language