Showing 3,272 of 4,939 total issues
Method generateIssueMap
has 4385 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function generateIssueMap(): array
{
// phpcs:disable Generic.Files.LineLength
/**
* @var list<Issue>
File Issue.php
has 5330 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
declare(strict_types=1);
namespace Phan;
File UnionType.php
has 3895 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
declare(strict_types=1);
namespace Phan\Language;
File ConstantDocumentationMap.php
has 3697 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php // phpcs:ignoreFile
namespace Phan\Language\Internal;
/**
* This contains descriptions used by Phan for hover text of internal constants (global and class constants) in the language server mode.
File PostOrderAnalysisVisitor.php
has 3473 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
declare(strict_types=1);
namespace Phan\Analysis;
File UnionTypeVisitor.php
has 2798 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
declare(strict_types=1);
namespace Phan\AST;
File TolerantASTConverter.php
has 2622 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
declare(strict_types=1);
namespace Phan\AST\TolerantASTConverter;
File Type.php
has 2507 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
declare(strict_types=1);
namespace Phan\Language;
File Clazz.php
has 2467 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
declare(strict_types=1);
namespace Phan\Language\Element;
File CLI.php
has 2193 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
declare(strict_types=1);
namespace Phan;
UnionType
has 279 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class UnionType implements Serializable
{
/**
* @var string
* A list of one or more types delimited by the '|'
File BlockAnalysisVisitor.php
has 2010 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
declare(strict_types=1);
namespace Phan;
File ContextNode.php
has 1912 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
declare(strict_types=1);
namespace Phan\AST;
Method initHandleMap
has 1041 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected static function initHandleMap(): array
{
$closures = [
/** @return ?ast\Node */
'Microsoft\PhpParser\Node\SourceFileNode' => static function (PhpParser\Node\SourceFileNode $n, int $start_line): ?\ast\Node {
Function __construct
has a Cognitive Complexity of 210 (exceeds 5 allowed). Consider refactoring. Open
Open
private function __construct(array $opts, array $argv)
{
self::detectAndConfigureColorSupport($opts);
if (\array_key_exists('extended-help', $opts)) {
- 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
EmptyUnionType
has 202 functions (exceeds 20 allowed). Consider refactoring. Open
Open
final class EmptyUnionType extends UnionType
{
/**
* An optional list of types represented by this union
* @internal
File AssignmentVisitor.php
has 1400 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
declare(strict_types=1);
namespace Phan\Analysis;
Function initHandleMap
has a Cognitive Complexity of 180 (exceeds 5 allowed). Consider refactoring. Open
Open
protected static function initHandleMap(): array
{
$closures = [
/** @return ?ast\Node */
'Microsoft\PhpParser\Node\SourceFileNode' => static function (PhpParser\Node\SourceFileNode $n, int $start_line): ?\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
File CodeBase.php
has 1377 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
declare(strict_types=1);
namespace Phan;
Method getAnalyzeFunctionCallClosuresStatic
has 714 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function getAnalyzeFunctionCallClosuresStatic(): array
{
$stop_exception = new StopParamAnalysisException();
/**