Showing 3,272 of 4,939 total issues
Method analyzeForCallback
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function analyzeForCallback(
FunctionInterface $method,
array $arg_nodes,
Context $context,
CodeBase $code_base,
Method visitClassNameNode
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function visitClassNameNode(Node $node): UnionType
{
$kind = $node->kind;
// Anonymous class of form `new class { ... }`
if ($kind === \ast\AST_CLASS
Method classTypesForNonName
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function classTypesForNonName(Node $node): UnionType
{
$node_type = UnionTypeVisitor::unionTypeFromNode(
$this->code_base,
$this->context,
Method createGoToDefinitionClosure
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function createGoToDefinitionClosure(GoToDefinitionRequest $request, CodeBase $code_base): Closure
{
/**
* @param list<Node> $parent_node_list
*/
Method addClosureForDependentTemplateType
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addClosureForDependentTemplateType(CodeBase $code_base, Context $context, array $template_type_list): void
{
if ($this->hasDependentReturnType()) {
// We already added this or this conflicts with a plugin.
return;
Method getReturnTypeOverridesStatic
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function getReturnTypeOverridesStatic(CodeBase $code_base): array
{
$basic_return_type_overrides = (new DependentReturnTypeOverridePlugin())->getReturnTypeOverrides($code_base);
/**
* @param callable-string $function
Method visitDim
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function visitDim(Node $node): Context
{
if (!Config::get_backward_compatibility_checks()) {
return $this->context;
}
Method isExpressionReturningReference
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function isExpressionReturningReference(CodeBase $code_base, Context $context, $node): bool
{
if (!($node instanceof Node)) {
return false;
}
Method analyzeClassAssertion
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function analyzeClassAssertion($object_node, $expr_node): ?Context
{
if (!($object_node instanceof Node)) {
return null;
}
Method visitNew
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function visitNew(Node $node): Context
{
$class_list = [];
try {
$context_node = new ContextNode(
Method parseCodePolyfill
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function parseCodePolyfill(CodeBase $code_base, Context $context, string $file_path, string $file_contents, bool $suppress_parse_errors, ?Request $request, array &$errors = []): Node
{
// @phan-suppress-next-line PhanRedundantCondition
if (!\in_array(Config::AST_VERSION, TolerantASTConverter::SUPPORTED_AST_VERSIONS, true)) {
throw new \Error(\sprintf("Unexpected polyfill version: want %s, got %d", \implode(', ', TolerantASTConverter::SUPPORTED_AST_VERSIONS), Config::AST_VERSION));
Method functionLikeFQSENListFromNode
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function functionLikeFQSENListFromNode($node): array
{
$orig_node = $node;
if ($node instanceof Node) {
$node = (new ContextNode($this->code_base, $this->context, $node))->getEquivalentPHPValue();
Function addInternalFunctionsByNames
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function addInternalFunctionsByNames(array $internal_function_name_list): void
{
$included_extension_subset = self::getIncludedExtensionSubset();
if (is_array($included_extension_subset)) {
$forbidden_function_set = [];
- 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 directoryNameToFileList
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private static function directoryNameToFileList(
string $directory_name
): array {
$file_list = [];
- 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 generateDefaultNodeRepresentation
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function generateDefaultNodeRepresentation(bool $is_internal = true): string
{
if (is_string($this->default_value_representation)) {
return $this->default_value_representation;
}
- 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 importAncestorClass
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function importAncestorClass(
CodeBase $code_base,
Clazz $class,
Option $type_option
): void {
- 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 toStubSignature
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function toStubSignature(CodeBase $code_base): string
{
$string = '';
if ($this->isFinal()) {
- 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 addParamsToScopeOfFunctionOrMethod
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public static function addParamsToScopeOfFunctionOrMethod(
Context $context,
CodeBase $code_base,
FunctionInterface $function,
Comment $comment
- 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 fromNode
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public static function fromNode(
Context $context,
CodeBase $code_base,
Node $node,
FullyQualifiedMethodName $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 asGeneratorTemplateType
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function asGeneratorTemplateType(): Type
{
$fallback_values = UnionType::empty();
$fallback_keys = UnionType::empty();
- 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"