Showing 3,272 of 4,939 total issues

Method analyzeOverrideRealSignature has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        CodeBase $code_base,
        Method $method,
        Clazz $class,
        Method $o_method,
        Clazz $o_class
Severity: Minor
Found in src/Phan/Analysis/ParameterTypesAnalyzer.php - About 35 mins to fix

    Method emitTypeMismatchReturnIssue has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        private function emitTypeMismatchReturnIssue(UnionType $expression_type, FunctionInterface $method, UnionType $method_return_type, int $lineno, $inner_node): void
    Severity: Minor
    Found in src/Phan/Analysis/PostOrderAnalysisVisitor.php - About 35 mins to fix

      Method compareYieldFromAgainstDeclaredType has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          private function compareYieldFromAgainstDeclaredType(Node $node, FunctionInterface $method, Context $context, array $template_type_list, UnionType $yield_from_type): Context
      Severity: Minor
      Found in src/Phan/Analysis/PostOrderAnalysisVisitor.php - About 35 mins to fix

        Method updateVariableWithNewType has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                Node $var_node,
                Context $context,
                UnionType $new_union_type,
                bool $suppress_issues,
                bool $is_weak_type_assertion
        Severity: Minor
        Found in src/Phan/Analysis/ConditionVisitorUtil.php - About 35 mins to fix

          Method checkInvalidArrayShapeCombination has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  CodeBase $code_base,
                  Context $context,
                  Node $node,
                  UnionType $left,
                  UnionType $right
          Severity: Minor
          Found in src/Phan/Analysis/BinaryOperatorFlagVisitor.php - About 35 mins to fix

            Method astNodeMethodCall has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                private static function astNodeMethodCall(int $kind, $expr, $method, ast\Node $args, int $start_line): ast\Node
            Severity: Minor
            Found in src/Phan/AST/TolerantASTConverter/TolerantASTConverter.php - About 35 mins to fix

              Method warnAboutInvalidUnaryOp has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      Node $node,
                      Closure $is_valid_type,
                      UnionType $type,
                      string $operator,
                      string $issue_type
              Severity: Minor
              Found in src/Phan/AST/UnionTypeVisitor.php - About 35 mins to fix

                Method analyzePrintfPattern has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    protected function analyzePrintfPattern(CodeBase $code_base, Context $context, FunctionInterface $function, $pattern_node, $arg_nodes): void
                Severity: Minor
                Found in .phan/plugins/PrintfCheckerPlugin.php - About 35 mins to fix

                  Method performChecks has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          AddressableElement $element,
                          string $issue_type_for_empty,
                          string $message_for_empty,
                          string $issue_type_for_unknown_array,
                          string $message_for_unknown_array
                  Severity: Minor
                  Found in .phan/plugins/UnknownElementTypePlugin.php - About 35 mins to fix

                    Method warnAboutInlineHTML has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        private function warnAboutInlineHTML(CodeBase $code_base, Context $context, array $token, int $i, int $n): void
                    Severity: Minor
                    Found in .phan/plugins/InlineHTMLPlugin.php - About 35 mins to fix

                      Method checkMovedArg has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          private function checkMovedArg(FunctionInterface $function, array $args, Node $node, array $arg_names, array $places_set = []): void
                      Severity: Minor
                      Found in .phan/plugins/SuspiciousParamOrderPlugin.php - About 35 mins to fix

                        Function forceLoadingInternalFunctions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function forceLoadingInternalFunctions(): void
                            {
                                $internal_function_fqsen_set = $this->internal_function_fqsen_set;
                                try {
                                    foreach ($internal_function_fqsen_set as $function_fqsen) {
                        Severity: Minor
                        Found in src/Phan/CodeBase.php - About 35 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function getRequestData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function getRequestData(): ?array
                            {
                                if (!$this->did_read_request_data) {
                                    $response_connection = $this->connection;
                                    if (!$response_connection) {
                        Severity: Minor
                        Found in src/Phan/Daemon/Transport/StreamResponder.php - About 35 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function locateClassCompletion has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private static function locateClassCompletion(
                                CompletionRequest $request,
                                CodeBase $code_base,
                                Context $context,
                                Node $node,
                        Severity: Minor
                        Found in src/Phan/LanguageServer/CompletionResolver.php - About 35 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function supportsColor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function supportsColor($output): bool
                            {
                                if (self::isDaemonOrLanguageServer()) {
                                    return false;
                                }
                        Severity: Minor
                        Found in src/Phan/CLI.php - About 35 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function didChangeWatchedFiles has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function didChangeWatchedFiles(array $changes): void
                            {
                                // invalidate Phan's cache for these files if changed, added, or modified outside of the IDE
                                foreach ($changes as $change) {
                                    $this->file_mapping->removeOverrideURI($change->uri);
                        Severity: Minor
                        Found in src/Phan/LanguageServer/Server/Workspace.php - About 35 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function kindForElement has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private static function kindForElement(TypedElementInterface $element): ?int
                            {
                                if ($element instanceof ClassConstant) {
                                    return CompletionItemKind::VARIABLE;
                                } elseif ($element instanceof Clazz) {
                        Severity: Minor
                        Found in src/Phan/LanguageServer/CompletionRequest.php - About 35 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function checkCanDaemonize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private static function checkCanDaemonize(string $protocol, string $opt): void
                            {
                                $opt = strlen($opt) >= 2 ? "--$opt" : "-$opt";
                                if (!in_array($protocol, \stream_get_transports(), true)) {
                                    throw new UsageException("The $protocol:///path/to/file schema is not supported on this system, cannot create a daemon with $opt", 1);
                        Severity: Minor
                        Found in src/Phan/CLI.php - About 35 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function locateClassDefinitionForUnionType has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private static function locateClassDefinitionForUnionType(
                                GoToDefinitionRequest $request,
                                CodeBase $code_base,
                                UnionType $union_type
                            ): bool {
                        Severity: Minor
                        Found in src/Phan/LanguageServer/DefinitionResolver.php - About 35 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function preloadBeforeForkingAnalysisWorkers has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private static function preloadBeforeForkingAnalysisWorkers(CodeBase $code_base): void
                            {
                                if (Config::getValue('language_server_use_pcntl_fallback')) {
                                    return;
                                }
                        Severity: Minor
                        Found in src/Phan/Phan.php - About 35 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Severity
                        Category
                        Status
                        Source
                        Language