Showing 3,272 of 4,939 total issues
Method visitMethod
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitMethod(Node $node): Context
{
$method_name = (string)$node->children['name'];
$code_base = $this->code_base;
$context = $this->context;
Method analyzePropertyTypes
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function analyzePropertyTypes(CodeBase $code_base, Clazz $clazz): void
{
foreach ($clazz->getPropertyMap($code_base) as $property) {
// This phase is done before the analysis phase, so there aren't any dynamic properties to filter out.
Method emitTypeMismatchReturnIssue
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function emitTypeMismatchReturnIssue(UnionType $expression_type, FunctionInterface $method, UnionType $method_return_type, int $lineno, $inner_node): void
{
if ($this->shouldSuppressIssue(Issue::TypeMismatchReturnReal, $lineno)) {
// Suppressing TypeMismatchReturnReal also suppresses less severe return type mismatches
return;
Method visitMethodCall
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitMethodCall(Node $node): Context
{
$method_name = $node->children['method'];
if (!\is_string($method_name)) {
Method methodListFromReflectionClassAndMethod
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function methodListFromReflectionClassAndMethod(
Context $context,
\ReflectionClass $class,
\ReflectionMethod $reflection_method
): array {
Method asFunctionInterfaceOrNull
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function asFunctionInterfaceOrNull(CodeBase $code_base, Context $context): ?FunctionInterface
{
if (\count($this->field_types) !== 2) {
Issue::maybeEmit(
$code_base,
Method visitPropGroup
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitPropGroup(Node $node): Context
{
// Bomb out if we're not in a class context
['props' => $props_node, 'type' => $type_node] = $node->children;
if (!$props_node instanceof Node) {
Method analyzeDuplicateFunction
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function analyzeDuplicateFunction(
CodeBase $code_base,
FunctionInterface $method
): void {
$fqsen = $method->getFQSEN();
Method getFunction
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getFunction(
string $function_name,
bool $is_function_declaration = false,
bool $return_placeholder_for_undefined = false
): FunctionInterface {
Method updateSignature
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function updateSignature(string $function_like_name, array $arguments_from_phan): array
{
$return_type = $arguments_from_phan[0];
$arguments_from_external_stub = $this->parseFunctionLikeSignature($function_like_name);
if (is_null($arguments_from_external_stub)) {
Method visitSwitchList
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitSwitchList(Node $node): void
{
$children = $node->children;
if (count($children) <= 1) {
// This plugin will never emit errors if there are 0 or 1 elements.
File ArrayType.php
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
declare(strict_types=1);
namespace Phan\Language\Type;
ClassElement
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Open
abstract class ClassElement extends AddressableElement
{
/** @var FullyQualifiedClassName the FQSEN of the class this ClassElement belongs to */
private $class_fqsen;
ScalarType
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Open
abstract class ScalarType extends NativeType
{
public function isScalar(): bool
{
return true;
TemplateType
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Open
final class TemplateType extends Type
{
/** @var string an identifier for the template type. */
private $template_type_identifier;
ArgumentType
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Open
final class ArgumentType
{
/**
* @param FunctionInterface $method
Method getFlagSuggestionString
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getFlagSuggestionString(
string $key
): string {
$trim = static function (string $s): string {
return \rtrim($s, ':');
Method __construct
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct(ProtocolReader $reader, ProtocolWriter $writer, CodeBase $code_base, Closure $file_path_lister)
{
parent::__construct($this, '/');
$this->protocolReader = $reader;
$this->file_mapping = new FileMapping();
Method computeExpandedTypesPreservingTemplate
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function computeExpandedTypesPreservingTemplate(CodeBase $code_base, int $recursion_depth): UnionType
{
$union_type = $this->asPHPDocUnionType();
$class_fqsen = $this->asFQSEN();
Method analyzeDuplicateClass
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function analyzeDuplicateClass(
CodeBase $code_base,
Clazz $clazz
): void {
// Determine if it's a duplicate by looking to see if