Showing 3,272 of 4,939 total issues
AssignmentVisitor
has 36 functions (exceeds 20 allowed). Consider refactoring. Open
class AssignmentVisitor extends AnalysisVisitor
{
/**
* @var UnionType
* The type of the element on the right side of the assignment
BinaryOperatorFlagVisitor
has 36 functions (exceeds 20 allowed). Consider refactoring. Open
final class BinaryOperatorFlagVisitor extends FlagVisitorImplementation
{
/**
* @var CodeBase The code base within which we're operating
Method analyzeFileList
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function analyzeFileList(
CodeBase $code_base,
Closure $file_path_lister
): bool {
if (Config::getValue('dump_parsed_file_list') === true) {
Method visitFor
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function visitFor(Node $node): Context
{
$context = $this->context->withLineNumberStart(
$node->lineno
);
Function warnInvalidArgumentType
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
private static function warnInvalidArgumentType(
CodeBase $code_base,
Context $context,
FunctionInterface $method,
Parameter $alternate_parameter,
- 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 combineTypesAfterWeakEqualityCheck
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
protected function combineTypesAfterWeakEqualityCheck(UnionType $old_union_type, UnionType $new_union_type): UnionType
{
// TODO: Be more precise about these checks - e.g. forbid anything such as stdClass == false in the new type
if (!$old_union_type->hasRealTypeSet()) {
// This is a weak check of equality. We aren't sure of the real types
- 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 init
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public static function init(): void
{
self::$noop = static function (Node $_): string {
return '(unknown)';
};
- 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 visitMethodCall
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function visitMethodCall(Node $node): UnionType
{
$method_name = $node->children['method'] ?? '';
// Give up on any complicated nonsense where the
- 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 getConst
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function getConst(): GlobalConstant
{
$node = $this->node;
if (!$node instanceof Node) {
throw new AssertionError('$node must be a 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 phan_repl_help
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
function phan_repl_help($value = "\x00extended_help"): void
{
if ($value === "\x00extended_help") {
echo "Phan " . CLI::PHAN_VERSION . " CLI autocompletion utilities.\n";
echo "Type help(\$value); or help('function or constant or class name'); for help.\n";
- 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 getAnalyzeFunctionCallClosures
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAnalyzeFunctionCallClosures(CodeBase $code_base): array
{
/**
* @return Closure(CodeBase, Context, FunctionInterface, list<mixed>):void
*/
Method processGraph
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function processGraph(array $cached_graph = null): void
{
$cmd = $_ENV['PDEP_CMD'];
$mode = $_ENV['PDEP_MODE'];
$this->depth = (int)$_ENV['PDEP_DEPTH'];
Comment
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
class Comment
{
public const ON_CLASS = 1;
public const ON_VAR = 2;
public const ON_PROPERTY = 3;
File ThrowAnalyzerPlugin.php
has 353 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace Phan\Plugin\Internal;
Function make
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
protected static function make(
string $namespace,
string $type_name,
array $template_parameter_type_list,
bool $is_nullable,
- 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 suggestVariableTypoFix
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public static function suggestVariableTypoFix(CodeBase $code_base, Context $context, string $variable_name, string $prefix = 'Did you mean'): ?Suggestion
{
if (Config::getValue('disable_suggestions')) {
return 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
Function isExpressionReturningReference
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public static function isExpressionReturningReference(CodeBase $code_base, Context $context, $node): bool
{
if (!($node instanceof Node)) {
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 guessErrorColumnUsingTokens
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
private static function guessErrorColumnUsingTokens(
FileCacheEntry $file_cache_entry,
Error $native_parse_error
): int {
if (!\function_exists('token_get_all')) {
- 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 methodFQSENListFromParts
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
private function methodFQSENListFromParts($class_or_expr, $method_name): array
{
$code_base = $this->code_base;
$context = $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 analyzeBackwardCompatibility
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public function analyzeBackwardCompatibility(): void
{
if (!Config::get_backward_compatibility_checks()) {
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"