Showing 3,272 of 4,939 total issues

Method preAnalyzeIfElemCondition has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function preAnalyzeIfElemCondition(Node $if_elem_node, Context $fallthrough_context): array
    {
        $condition_node = $if_elem_node->children['cond'];
        if ($condition_node instanceof Node) {
            if ($condition_node->kind === ast\AST_BINARY_OP) {
Severity: Minor
Found in src/Phan/BlockAnalysisVisitor.php - About 1 hr to fix

    Method warnAboutNonTraversableType has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function warnAboutNonTraversableType(Node $node, Type $type): void
        {
            $fqsen = FullyQualifiedClassName::fromType($type);
            if (!$this->code_base->hasClassWithFQSEN($fqsen)) {
                return;
    Severity: Minor
    Found in src/Phan/BlockAnalysisVisitor.php - About 1 hr to fix

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

          public function visitMethodCall(Node $node): void
          {
              $context = $this->context;
              if (!$context->isInFunctionLikeScope()) {
                  return;
      Severity: Minor
      Found in src/Phan/Plugin/Internal/ThrowAnalyzerPlugin.php - About 1 hr to fix

        Method visitStaticCall has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function visitStaticCall(Node $node): void
            {
                $context = $this->context;
                if (!$context->isInFunctionLikeScope()) {
                    return;
        Severity: Minor
        Found in src/Phan/Plugin/Internal/ThrowAnalyzerPlugin.php - About 1 hr to fix

          Method mergeBranchScopeList has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function mergeBranchScopeList(
                  array $branch_scopes,
                  bool $merge_parent_scope,
                  array $inner_exiting_scope_list
              ): VariableTrackingScope {
          Severity: Minor
          Found in src/Phan/Plugin/Internal/VariableTracker/VariableTrackingScope.php - About 1 hr to fix

            Method addDefaultPropertiesOfThisToContext has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function addDefaultPropertiesOfThisToContext(Clazz $class, Context $context): void
                {
                    $property_types = [];
                    foreach ($class->getPropertyMap($this->code_base) as $property) {
                        if ($property->isDynamicOrFromPHPDoc()) {
            Severity: Minor
            Found in src/Phan/Analysis/PreOrderAnalysisVisitor.php - About 1 hr to fix

              Method removeTypesNotSupportingAccessFromVariable has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  final protected function removeTypesNotSupportingAccessFromVariable(Node $var_node, Context $context, int $access_type): Context
                  {
                      return $this->updateVariableWithConditionalFilter(
                          $var_node,
                          $context,
              Severity: Minor
              Found in src/Phan/Analysis/ConditionVisitorUtil.php - About 1 hr to fix

                Method maybeWarnWriteOnlyProperty has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private static function maybeWarnWriteOnlyProperty(CodeBase $code_base, Property $property): void
                    {
                        if ($property->isWriteOnly()) {
                            // Handle annotations such as property-write and phan-write-only
                            return;
                Severity: Minor
                Found in src/Phan/Analysis/ReferenceCountsAnalyzer.php - About 1 hr to fix

                  Method maybeWarnReadOnlyProperty has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private static function maybeWarnReadOnlyProperty(CodeBase $code_base, Property $property): void
                      {
                          if ($property->isReadOnly()) {
                              // Handle annotations such as property-read and phan-read-only.
                              return;
                  Severity: Minor
                  Found in src/Phan/Analysis/ReferenceCountsAnalyzer.php - About 1 hr to fix

                    Method updateVariableWithConditionalFilter has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        final protected function updateVariableWithConditionalFilter(
                            Node $var_node,
                            Context $context,
                            Closure $should_filter_cb,
                            Closure $filter_union_type_cb,
                    Severity: Minor
                    Found in src/Phan/Analysis/ConditionVisitorUtil.php - About 1 hr to fix

                      Method maybeWarnSameNamespaceUse has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function maybeWarnSameNamespaceUse(string $alias, FullyQualifiedGlobalStructuralElement $target, int $flags, int $lineno): void
                          {
                              if (\strcasecmp($alias, $target->getName()) !== 0) {
                                  return;
                              }
                      Severity: Minor
                      Found in src/Phan/Analysis/ScopeVisitor.php - About 1 hr to fix

                        Method analyzeBinaryNumericOp has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function analyzeBinaryNumericOp(Node $node): void
                            {
                                $left = UnionTypeVisitor::unionTypeFromNode(
                                    $this->code_base,
                                    $this->context,
                        Severity: Minor
                        Found in src/Phan/Analysis/PostOrderAnalysisVisitor.php - About 1 hr to fix

                          Method phpParserExprListToExprList has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private static function phpParserExprListToExprList(PhpParser\Node\DelimitedList\ExpressionList $expressions_list, int $lineno): ast\Node
                              {
                                  $children = [];
                                  $expressions_children = $expressions_list->children;
                                  foreach ($expressions_children as $expr) {
                          Severity: Minor
                          Found in src/Phan/AST/TolerantASTConverter/TolerantASTConverter.php - About 1 hr to fix

                            Method visitClassNameNode has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function visitClassNameNode(Node $node): ?UnionType
                                {
                                    // Things of the form `new $className()`, `new $obj()`, `new (foo())()`, etc.
                                    if ($node->kind !== \ast\AST_NAME) {
                                        return null;
                            Severity: Minor
                            Found in src/Phan/AST/FallbackUnionTypeVisitor.php - About 1 hr to fix

                              Method classListFromNode has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private function classListFromNode(Node $node): \Generator
                                  {
                                      // Get the types associated with the node
                                      $union_type = self::unionTypeFromNode(
                                          $this->code_base,
                              Severity: Minor
                              Found in src/Phan/AST/UnionTypeVisitor.php - About 1 hr to fix

                                Method getAvailablePropertyPHPDocSummaries has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    protected function getAvailablePropertyPHPDocSummaries(): array
                                    {
                                        return $this->memoize(__METHOD__, /** @return array<string,string> */ function (): array {
                                            $map = [];
                                            foreach ($this->getClassXMLFiles() as $xml) {
                                Severity: Minor
                                Found in internal/lib/IncompatibleXMLSignatureDetector.php - About 1 hr to fix

                                  Method finalizeProcess has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function finalizeProcess(CodeBase $code_base): void
                                      {
                                          echo "<" . "?php declare(strict_types=1);\n";
                                          ksort(self::$calls);
                                          foreach (self::$calls as $namespace => $name_set) {
                                  Severity: Minor
                                  Found in internal/lib/NotFullyQualifiedReporterPlugin.php - About 1 hr to fix

                                    Method processVariable has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        protected function processVariable(File $phpcs_file, $stack_ptr)
                                        {
                                            if ($this->isExcluded($phpcs_file)) {
                                                return;
                                            }

                                      Method analyzeClass has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function analyzeClass(
                                              CodeBase $code_base,
                                              Clazz $class
                                          ): void {
                                              if ($class->isAnonymous()) {
                                      Severity: Minor
                                      Found in .phan/plugins/HasPHPDocPlugin.php - About 1 hr to fix

                                        Method read has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function read(): bool
                                            {
                                                if ($this->done) {
                                                    return true;
                                                }
                                        Severity: Minor
                                        Found in .phan/plugins/InvokePHPNativeSyntaxCheckPlugin.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language