Showing 3,272 of 4,939 total issues
Function visitClass
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function visitClass(Node $node): void
{
if (!Config::get_track_references()) {
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 __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
string $label = null,
int $kind = null,
string $detail = null,
string $documentation = null,
string $sortText = null,
Method makeLanguageServerAnalysisRequest
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Responder $responder,
array $file_names,
CodeBase $code_base,
Closure $file_path_lister,
FileMapping $file_mapping,
Method analyzeMatchArm
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Context $child_context,
Context $fallthrough_context,
?Closure $match_variable_condition,
?Closure $match_variable_negated_condition,
Node $arm_node,
Method maybeEmitWithParameters
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
CodeBase $code_base,
Context $context,
string $issue_type,
int $lineno,
array $parameters,
Method emitIssueForBinaryOp
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Node $node,
UnionType $left,
UnionType $right,
string $issue_name,
Closure $is_still_issue,
Method analyzeRemainingParametersForVariadic
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
CodeBase $code_base,
Context $context,
FunctionInterface $method,
int $start_index,
Node $node,
Method emitInstance
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$node,
CodeBase $code_base,
Context $context,
string $issue_name,
array $issue_args,
Method parseCodePolyfill
has 7 arguments (exceeds 4 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
Method checkPassingPropertyByReference
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
private static function checkPassingPropertyByReference(CodeBase $code_base, Context $context, FunctionInterface $method, Parameter $parameter, Node $argument, Property $property, int $parameter_offset): void
Method handleParseError
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
CodeBase $code_base,
Context $context,
string $file_path,
string $file_contents,
bool $suppress_parse_errors,
Method astNodeParam
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
private static function astNodeParam(bool $is_nullable, bool $by_ref, bool $variadic, ?\ast\Node $type, string $name, $default, int $line): ast\Node
Function getExpandedTypesDetails
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function getExpandedTypesDetails(): string
{
$result = [];
foreach (\debug_backtrace() as $frame) {
if (($frame['function'] ?? null) === 'asExpandedTypes' && isset($frame['object'])) {
- 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 checkPluginsExist
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static function checkPluginsExist(): void
{
$all_plugins_exist = true;
foreach (Config::getValue('plugins') as $plugin_path_or_name) {
// @phan-suppress-next-line PhanAccessMethodInternal
- 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 outputProgressLine
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function outputProgressLine(string $msg, float $p, float $memory, float $peak, ?int $offset = null, ?int $count = null): void
Function progress
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function progress(
string $msg,
float $p,
$details = null,
?int $offset = null,
- 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 locatePropertyCompletion
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
CompletionRequest $request,
CodeBase $code_base,
Context $context,
Node $node,
bool $is_static,
Method locateMethodCompletion
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
CompletionRequest $request,
CodeBase $code_base,
Context $context,
Node $node,
bool $is_static,
Function createCompletionClosure
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function createCompletionClosure(CompletionRequest $request, CodeBase $code_base): Closure
{
/**
* @param list<Node> $parent_node_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 addClassesByNames
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function addClassesByNames(array $class_name_list): void
{
$included_extension_subset = self::getIncludedExtensionSubset();
foreach ($class_name_list as $class_name) {
$reflection_class = new \ReflectionClass($class_name);
- 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"