Showing 3,272 of 4,939 total issues

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

    private function quickWarn(FunctionInterface $method, string $fqsen, Node $node): bool
    {
        if (!$method->isPure()) {
            $fqsen_key = \strtolower(\ltrim($fqsen, "\\"));
            $result = UseReturnValuePlugin::HARDCODED_FQSENS[$fqsen_key] ?? null;

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

        public function visitFor(Node $node): VariableTrackingScope
        {
            $this->checkIsSideEffectFreeLoopNode($node);
    
            $top_level_statement = $this->top_level_statement;
    Severity: Minor
    Found in src/Phan/Plugin/Internal/VariableTracker/VariableTrackerVisitor.php - About 1 hr to fix

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

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

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

            public function visitInstanceof(Node $node): Context
            {
                //$this->checkVariablesDefined($node);
                // Only look at things of the form
                // `$variable instanceof ClassName`
        Severity: Minor
        Found in src/Phan/Analysis/ConditionVisitor.php - About 1 hr to fix

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

              public function visitBinaryCoalesce(Node $node): UnionType
              {
                  $left_node = $node->children['left'];
                  $left_type = UnionTypeVisitor::unionTypeFromNode(
                      $this->code_base,
          Severity: Minor
          Found in src/Phan/Analysis/BinaryOperatorFlagVisitor.php - About 1 hr to fix

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

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

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

                  public function visit(Node $node): UnionType
                  {
                      // TODO: For some types (e.g. xor, bitwise or), set the type of the variable?
                      // Or should that be done in PreOrderAnalysisVisitor?
                      $left = UnionTypeVisitor::unionTypeFromNode(
              Severity: Minor
              Found in src/Phan/Analysis/AssignOperatorFlagVisitor.php - About 1 hr to fix

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

                    private static function checkCommentParametersAreInOrder(CodeBase $code_base, FunctionInterface $method): void
                    {
                        $comment = $method->getComment();
                        if ($comment === null) {
                            return;
                Severity: Minor
                Found in src/Phan/Analysis/ParameterTypesAnalyzer.php - About 1 hr to fix

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

                      private static function parseMultiPartHeredoc(PhpParser\Node\StringLiteral $n, array $children): ast\Node
                      {
                          $inner_node_parts = [];
                          $end_of_start_quote = self::$file_contents[$n->startQuote->start + $n->startQuote->length - 1];
                          $end_quote_text = $n->endQuote->getText(self::$file_contents);
                  Severity: Minor
                  Found in src/Phan/AST/TolerantASTConverter/TolerantASTConverter.php - About 1 hr to fix

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

                        public function visitTypeUnion(Node $node): UnionType
                        {
                            // TODO: Validate that there aren't any duplicates
                            if (\count($node->children) === 1) {
                                // Might be possible due to the polyfill in the future.
                    Severity: Minor
                    Found in src/Phan/AST/UnionTypeVisitor.php - About 1 hr to fix

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

                          public static function parseNodeInContext(CodeBase $code_base, Context $context, Node $node)
                          {
                              $kind = $node->kind;
                              $context->setLineNumberStart($node->lineno);
                      
                      
                      Severity: Minor
                      Found in src/Phan/Analysis.php - About 1 hr to fix

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

                            public function visitStmtList(Node $node): void
                            {
                                if (count($node->children) <= 1) {
                                    return;
                                }
                        Severity: Minor
                        Found in .phan/plugins/DuplicateConstantPlugin.php - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                                      if (!($o_return_union_type->isEqualTo($return_union_type) || (
                                          ($o_return_union_type->containsNullable() && !$o_return_union_type->isNull()) && ($o_return_union_type->nonNullableClone()->isEqualTo($return_union_type)))
                                          )) {
                                          // There is one exception to this in php 7.1 - the pseudo-type "iterable" can replace ArrayAccess/array in a subclass
                                          // TODO: Traversable and array work, but Iterator doesn't. Check for those specific cases?
                          Severity: Critical
                          Found in src/Phan/Analysis/ParameterTypesAnalyzer.php - About 1 hr to fix

                            Consider simplifying this complex logical expression.
                            Open

                                    if (!$method->isAbstract()
                                        && !$method->isFromPHPDoc()
                                        && !$has_interface_class
                                        && !$return_type->isEmpty()
                                        && !$method->hasReturn()
                            Severity: Critical
                            Found in src/Phan/Analysis/PostOrderAnalysisVisitor.php - About 1 hr to fix

                              Method createRestorePoint has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function createRestorePoint(): array
                                  {
                                      // Create a deep copy of this CodeBase
                                      $clone = clone($this);
                                      // make a deep copy of the NamespaceMapEntry objects within parsed_namespace_maps
                              Severity: Minor
                              Found in src/Phan/CodeBase.php - About 1 hr to fix

                                Method suggestSimilarClassInSameNamespace has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function suggestSimilarClassInSameNamespace(
                                        FullyQualifiedClassName $missing_class,
                                        Context $context,
                                        int $class_suggest_type = IssueFixSuggester::CLASS_SUGGEST_ONLY_CLASSES
                                    ): array {
                                Severity: Minor
                                Found in src/Phan/CodeBase.php - About 1 hr to fix

                                  Method fromFullyQualifiedString has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public static function fromFullyQualifiedString(
                                          string $fully_qualified_string
                                      ) {
                                  
                                          $key = static::class . '|' . $fully_qualified_string;
                                  Severity: Minor
                                  Found in src/Phan/Language/FQSEN/FullyQualifiedGlobalStructuralElement.php - About 1 hr to fix

                                    Method checkUnreachableCatch has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        private function checkUnreachableCatch(array $catch_nodes, Context $context): void
                                        {
                                            if (count($catch_nodes) <= 1) {
                                                return;
                                            }
                                    Severity: Minor
                                    Found in src/Phan/BlockAnalysisVisitor.php - About 1 hr to fix

                                      Method suggestSimilarClass has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public static function suggestSimilarClass(
                                              CodeBase $code_base,
                                              Context $context,
                                              FullyQualifiedClassName $class_fqsen,
                                              ?Closure $filter = null,
                                      Severity: Minor
                                      Found in src/Phan/IssueFixSuggester.php - About 1 hr to fix

                                        Method analyzeForeachIteration has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            private function analyzeForeachIteration(Context $context, UnionType $expression_union_type, Node $node): Context
                                            {
                                                $code_base = $this->code_base;
                                                $value_node = $node->children['value'];
                                                if ($value_node instanceof Node) {
                                        Severity: Minor
                                        Found in src/Phan/BlockAnalysisVisitor.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language