Showing 3,272 of 4,939 total issues
Method warnAboutInvalidUnionType
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Node $node,
Closure $is_valid_type,
UnionType $left,
UnionType $right,
string $left_issue_type,
Function visit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function visit(Node $node): UnionType
{
$left = UnionTypeVisitor::unionTypeFromNode(
$this->code_base,
$this->context,
- 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 analyzeParameterTypesDocblockSignaturesMatch
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static function analyzeParameterTypesDocblockSignaturesMatch(
CodeBase $code_base,
FunctionInterface $method
): void {
$phpdoc_parameter_map = $method->getPHPDocParameterTypeMap();
- 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
Method analyzeReturnStrict
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
CodeBase $code_base,
FunctionInterface $method,
UnionType $expression_type,
UnionType $method_return_type,
int $lineno,
Function checkCommentParametersAreInOrder
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static function checkCommentParametersAreInOrder(CodeBase $code_base, FunctionInterface $method): void
{
$comment = $method->getComment();
if ($comment === null) {
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"
Further reading
Method warnAboutInvalidUnionType
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Node $node,
Closure $is_valid_type,
UnionType $left,
UnionType $right,
string $left_issue_type,
Method analyzeWriteOnlyReference
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
CodeBase $code_base,
Context $context,
FunctionInterface $method,
Closure $set_variable_type,
array $argument_list,
Function guessErrorColumnUsingPolyfill
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static function guessErrorColumnUsingPolyfill(
CodeBase $code_base,
Context $context,
string $file_path,
FileCacheEntry $file_cache_entry,
- 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
Method guessErrorColumnUsingPolyfill
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
CodeBase $code_base,
Context $context,
string $file_path,
FileCacheEntry $file_cache_entry,
Error $native_parse_error,
Method updateVariableWithConditionalFilter
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Node $var_node,
Context $context,
Closure $should_filter_cb,
Closure $filter_union_type_cb,
bool $suppress_issues,
Function getVariableSet
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function getVariableSet($node): array
{
if (!$node instanceof Node) {
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"
Further reading
Method parseCode
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
CodeBase $code_base,
Context $context,
?Request $request,
string $file_path,
string $file_contents,
Method updateParameterTypeByArgument
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
FunctionInterface $method,
Parameter $parameter,
$argument,
array $argument_types,
array &$parameter_list,
Method emitSyntaxErrorForNativeParseError
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
CodeBase $code_base,
Context $context,
string $file_path,
FileCacheEntry $file_cache_entry,
Error $native_parse_error,
Function readQueuedIssues
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function readQueuedIssues(): void
{
// Get the status of the queue
// @phan-suppress-next-line PhanTypeMismatchArgumentInternal different in php 8.0
$status = \msg_stat_queue($this->message_queue_resource);
- 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 markNodeAsSelected
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static function markNodeAsSelected($n, $ast_node): void
{
// fwrite(STDERR, "Marking corresponding node as flagged: " . json_encode($n) . "\n" . \Phan\Debug::nodeToString($ast_node) . "\n");
// fflush(STDERR);
if ($ast_node instanceof ast\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 phpParserClosureUsesToAstClosureUses
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static function phpParserClosureUsesToAstClosureUses(
?\Microsoft\PhpParser\Node\DelimitedList\UseVariableNameList $uses,
int $line
): ?\ast\Node {
$children = $uses->children ?? [];
- 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 astNodeBinaryop
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static function astNodeBinaryop(int $flags, PhpParser\Node\Expression\BinaryExpression $n, int $start_line)
{
try {
$left_node = static::phpParserNodeToAstNode($n->leftOperand);
} catch (InvalidNodeException $_) {
- 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 phpParserPropelemToAstPropelem
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static function phpParserPropelemToAstPropelem($n, ?string $doc_comment): ast\Node
{
if ($n instanceof PhpParser\Node\Expression\AssignmentExpression) {
$name_node = $n->leftOperand;
if (!($name_node instanceof PhpParser\Node\Expression\Variable)) {
- 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 checkCalledFunction
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function checkCalledFunction(Node $node, FunctionInterface $method): void
{
if ($method->isPure()) {
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"