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
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
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
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
Method checkInvalidArrayShapeCombination
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
CodeBase $code_base,
Context $context,
Node $node,
UnionType $left,
UnionType $right
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
Method warnAboutInvalidUnaryOp
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Node $node,
Closure $is_valid_type,
UnionType $type,
string $operator,
string $issue_type
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
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
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
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
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) {
- Read upRead up
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) {
- Read upRead up
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,
- Read upRead up
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;
}
- Read upRead up
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);
- Read upRead up
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) {
- Read upRead up
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);
- Read upRead up
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 {
- Read upRead up
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;
}
- Read upRead up
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"