Showing 3,272 of 4,939 total issues
Method updateVariableToBeNotEqual
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
final public function updateVariableToBeNotEqual(
Node $var_node,
$expr,
Context $context = null
): Context {
Method visitContinue
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitContinue(Node $node): Context
{
$nodes = $this->parent_node_list;
$depth = $node->children['depth'] ?? 1;
if (!\is_int($depth)) {
Method visitDim
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitDim(Node $node): Context
{
$code_base = $this->code_base;
$context = $this->context;
// Check the dimension type to trigger PhanUndeclaredVariable, etc.
Method analyzeOverrideSignature
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function analyzeOverrideSignature(
CodeBase $code_base,
Method $method
): void {
if (!Config::getValue('analyze_signature_compatibility')) {
Method guessErrorColumnUsingPolyfill
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function guessErrorColumnUsingPolyfill(
CodeBase $code_base,
Context $context,
string $file_path,
FileCacheEntry $file_cache_entry,
Method visitCast
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitCast(Node $node): UnionType
{
// This calls unionTypeFromNode to trigger any warnings
// TODO: Check if the cast would throw an error at runtime, based on the type (e.g. casting object to string/int)
Method visitName
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitName(Node $node): UnionType
{
$name = $node->children['name'];
try {
if ($node->flags & \ast\flags\NAME_NOT_FQ) {
Method analyzeUnpack
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function analyzeUnpack(Node $node, bool $is_array_spread): UnionType
{
$union_type = self::unionTypeFromNode(
$this->code_base,
$this->context,
Method resolveClassNameInContext
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function resolveClassNameInContext(): ?FullyQualifiedClassName
{
// A function argument to resolve into an FQSEN
$arg = $this->node;
Method printUsageAndExit
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected static function printUsageAndExit(int $exit_code = 1): void
{
global $argv;
$program_name = $argv[0];
$msg = <<<EOT
Method parseMethodSignature
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function parseMethodSignature(string $class_name, string $method_name): ?array
{
$this->initStubs();
if ($class_name[0] !== '\\') {
$class_name = '\\' . $class_name;
Method getAvailablePropertyPHPDocSummaries
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function getAvailablePropertyPHPDocSummaries(): array
{
return $this->memoize(__METHOD__, /** @return array<string,string> */ function (): array {
$code_base = $this->code_base;
$map = [];
Method afterAnalyzeFile
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function afterAnalyzeFile(
CodeBase $code_base,
Context $context,
string $file_contents,
Node $node
Method parseMethodSignature
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function parseMethodSignature(string $class_name, string $method_name): ?array
{
$this->initStubs();
if ($class_name[0] !== '\\') {
$class_name = '\\' . $class_name;
Method getAvailablePropertyPHPDocSummaries
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function getAvailablePropertyPHPDocSummaries(): array
{
return $this->memoize(__METHOD__, /** @return array<string,string> */ function (): array {
$code_base = $this->code_base;
$map = [];
Method checkPropGroupDescription
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function checkPropGroupDescription(Clazz $class, Node $node): ?ClassElementEntry
{
$property_name = $node->children['props']->children[0]->children['name'] ?? null;
if (!is_string($property_name)) {
return null;
Method visitSwitch
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitSwitch(Node $node): void
{
// Check all case statements and return if something that isn't a no-op is seen.
foreach ($node->children['stmts']->children ?? [] as $c) {
if (!$c instanceof Node) {
Method visitClass
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitClass(Node $node): void
{
if (!$this->context->isInClassScope()) {
// should be impossible
return;
Method generateCompletions
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function generateCompletions(string $text, int $start, int $end): array
{
$this->setReadlineConfig('completion_append_character', "\x00");
try {
// TODO: PHP's API only allows us to fetch the most recent line.
Method addGlobalConstantsByNames
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function addGlobalConstantsByNames(array $const_name_list): void
{
$included_extension_subset = self::getIncludedExtensionSubset();
if (is_array($included_extension_subset)) {
$excluded_constant_set = [];