Showing 3,272 of 4,939 total issues

Method fromTypeInSignature has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function fromTypeInSignature(Node $node): UnionType
    {
        $is_nullable = $node->kind === ast\AST_NULLABLE_TYPE;
        if ($is_nullable) {
            $node = $node->children['type'];
Severity: Minor
Found in src/Phan/AST/UnionTypeVisitor.php - About 1 hr to fix

    Method getOrCreateVariableForReferenceParameter has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getOrCreateVariableForReferenceParameter(Parameter $parameter, ?Parameter $real_parameter): Variable
        {
            // Return the original variable if it existed
            try {
                $variable = $this->getVariable();
    Severity: Minor
    Found in src/Phan/AST/ContextNode.php - About 1 hr to fix

      Method getEquivalentPHPArrayElements has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function getEquivalentPHPArrayElements(Node $node, int $flags): ?array
          {
              $elements = [];
              foreach ($node->children as $child_node) {
                  if (!($child_node instanceof Node)) {
      Severity: Minor
      Found in src/Phan/AST/ContextNode.php - About 1 hr to fix

        Method streamPutContents has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private static function streamPutContents($stream, string $file_contents): void
            {
                try {
                    while (strlen($file_contents) > 0) {
                        $bytes_written = fwrite($stream, $file_contents);
        Severity: Minor
        Found in .phan/plugins/InvokePHPNativeSyntaxCheckPlugin.php - About 1 hr to fix

          Method updateFunctionSignaturesParamNames has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function updateFunctionSignaturesParamNames(): void
              {
                  $phan_signatures = static::readSignatureMap();
                  $new_signatures = [];
                  foreach ($phan_signatures as $method_name => $arguments) {
          Severity: Minor
          Found in internal/lib/IncompatibleRealStubsSignatureDetector.php - About 1 hr to fix

            Method afterAnalyzeFile has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function afterAnalyzeFile(
                    CodeBase $code_base,
                    Context $context,
                    string $file_contents,
                    Node $node
            Severity: Minor
            Found in .phan/plugins/WhitespacePlugin.php - About 1 hr to fix

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

                      string $name,
                      UnionType $type,
                      int $lineno = 0,
                      bool $is_variadic = false,
                      bool $has_default_value = false,
              Severity: Major
              Found in src/Phan/Language/Element/Comment/Parameter.php - About 1 hr to fix

                Method emitPluginIssue has 9 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        CodeBase $code_base,
                        Context $context,
                        string $issue_type,
                        string $issue_message_fmt,
                        array $issue_message_args = [],
                Severity: Major
                Found in src/Phan/PluginV3/IssueEmitter.php - About 1 hr to fix

                  Method addConstant has 9 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          CodeBase $code_base,
                          Context $context,
                          int $lineno,
                          string $name,
                          $value,
                  Severity: Major
                  Found in src/Phan/Parse/ParseVisitor.php - About 1 hr to fix

                    Method addProperty has 9 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        private function addProperty(Clazz $class, string $property_name, $default_node, UnionType $real_union_type, ?Comment\Parameter $variable, int $lineno, int $flags, ?string $doc_comment, Comment $property_comment): ?Property
                    Severity: Major
                    Found in src/Phan/Parse/ParseVisitor.php - About 1 hr to fix

                      Method analyzeParameterStrict has 9 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          private static function analyzeParameterStrict(CodeBase $code_base, Context $context, FunctionInterface $method, $argument_node, UnionType $argument_type, Variable $alternate_parameter, UnionType $parameter_type, int $lineno, int $i): void
                      Severity: Major
                      Found in src/Phan/Analysis/ArgumentType.php - About 1 hr to fix

                        Method astDeclClosure has 9 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                bool $by_ref,
                                bool $static,
                                ast\Node $params,
                                ?\ast\Node $uses,
                                ast\Node $stmts,
                        Severity: Major
                        Found in src/Phan/AST/TolerantASTConverter/TolerantASTConverter.php - About 1 hr to fix

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

                              public function suggestSimilarGlobalFunctionInNewerVersion(
                                  string $namespace,
                                  string $function_name,
                                  Context $context,
                                  bool $suggest_in_global_namespace
                          Severity: Minor
                          Found in src/Phan/CodeBase.php - About 1 hr to fix

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

                                public function recomputeFileList(): void
                                {
                                    $this->file_list = $this->file_list_in_config;
                            
                                    if (!$this->file_list_only) {
                            Severity: Minor
                            Found in src/Phan/CLI.php - About 1 hr to fix

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

                                  public function toStub(bool $class_is_interface = false): string
                                  {
                                      $string = '    ';
                                      if ($this->isFinal()) {
                                          $string .= 'final ';
                              Severity: Minor
                              Found in src/Phan/Language/Element/Method.php - About 1 hr to fix

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

                                    public static function functionListFromReflectionFunction(
                                        FullyQualifiedFunctionName $fqsen,
                                        \ReflectionFunction $reflection_function
                                    ): array {
                                
                                
                                Severity: Minor
                                Found in src/Phan/Language/Element/FunctionFactory.php - About 1 hr to fix

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

                                      public static function fromStringInContext(
                                          string $fqsen_string,
                                          Context $context
                                      ) {
                                          $parts = \explode('::', $fqsen_string);
                                  Severity: Minor
                                  Found in src/Phan/Language/FQSEN/FullyQualifiedClassElement.php - About 1 hr to fix

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

                                        protected function canCastToNonNullableTypeHandlingTemplates(Type $type, CodeBase $code_base): bool
                                        {
                                            if (parent::canCastToNonNullableTypeHandlingTemplates($type, $code_base)) {
                                                return true;
                                            }
                                    Severity: Minor
                                    Found in src/Phan/Language/Type/FunctionLikeDeclarationType.php - About 1 hr to fix

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

                                          public function getTemplateTypeExtractorClosure(CodeBase $code_base, TemplateType $template_type): ?Closure
                                          {
                                              // Create a closure to extract types for the template type from the return type and param types.
                                              $closure = $this->getReturnTemplateTypeExtractorClosure($code_base, $template_type);
                                              foreach ($this->params as $i => $param) {
                                      Severity: Minor
                                      Found in src/Phan/Language/Type/FunctionLikeDeclarationType.php - About 1 hr to fix

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

                                            private static function applyUnaryBitwiseNotOperatorToList(array $type_set, bool $is_real): array
                                            {
                                                if (!$type_set) {
                                                    // Can be int|string
                                                    return UnionType::typeSetFromString($is_real ? 'int|string' : 'int');
                                        Severity: Minor
                                        Found in src/Phan/Language/UnionType.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language