Showing 3,272 of 4,939 total issues
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return $this->context;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return $node;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return true;
Function shouldParse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function shouldParse(string $file_path): bool
{
$exclude_file_regex = Config::getValue('exclude_file_regex');
if ($exclude_file_regex && self::isPathMatchedByRegex($exclude_file_regex, $file_path)) {
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 debugProgress
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function debugProgress(string $msg, float $p, $details): void
{
$pct = \sprintf("%d%%", (int)(100 * self::boundPercentage($p)));
if ($details === 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 detectAndConfigureColorSupport
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static function detectAndConfigureColorSupport(array $opts): void
{
if (is_string($opts['color-scheme'] ?? false)) {
\putenv('PHAN_COLOR_SCHEME=' . $opts['color-scheme']);
}
- 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 renderInnerProgressBar
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static function renderInnerProgressBar(int $length, float $p): string
{
$current_float = $p * $length;
$current = (int)$current_float;
$rest = \max($length - $current, 0);
- 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 suggestSimilarNewInAnyNamespace
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function suggestSimilarNewInAnyNamespace(
string $namespace,
string $name,
Context $context,
bool $suggest_in_global_namespace
- 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 labelForElement
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static function labelForElement(TypedElementInterface $element): string
{
if (self::useVSCodeCompletion()) {
$name = $element->getName();
if ($element instanceof 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 recomputeFileList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function recomputeFileList(): void
{
$this->file_list = $this->file_list_in_config;
if (!$this->file_list_only) {
- 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 setLogFile
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function setLogFile($new_file): void
{
if (!\is_resource($new_file)) {
throw new \TypeError("Expected newFile to be a resource, got " . \gettype($new_file));
}
- 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 createCompletionItem
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static function createCompletionItem(
CodeBase $code_base,
TypedElementInterface $element,
?string $prefix = null
): CompletionItem {
- 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 suggestSimilarClassInSameNamespace
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function suggestSimilarClassInSameNamespace(
FullyQualifiedClassName $missing_class,
Context $context,
int $class_suggest_type = IssueFixSuggester::CLASS_SUGGEST_ONLY_CLASSES
): array {
- 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"