Showing 3,272 of 4,939 total issues
Method finalizeProcess
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function finalizeProcess(CodeBase $code_base): void
{
foreach (self::$method_return_types as $type_info) {
$function = $type_info->function;
$function_context = $function->getContext();
Method analyzeFunctionLikeParam
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function analyzeFunctionLikeParam(CodeBase $code_base, FunctionInterface $method, Node $param_node): void
{
$param_type = $param_node->children['type'];
if (!$param_type instanceof Node) {
return;
Method shouldWarnAboutMoreSpecificType
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function shouldWarnAboutMoreSpecificType(CodeBase $code_base, UnionType $actual_type, UnionType $declared_return_type): bool
{
if ($declared_return_type->isEmpty()) {
// There was no phpdoc type declaration, so let UnknownElementTypePlugin warn about that instead of this.
// This plugin warns about `@return mixed` but not the absence of a declaration because the former normally prevents phan from inferring something more specific.
Method performChecks
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function performChecks(
AddressableElement $element,
string $issue_type_for_empty,
string $message_for_empty,
string $issue_type_for_unknown_array,
Method exportFunctionAndMethodSet
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function exportFunctionAndMethodSet(): array
{
$result = [];
foreach ($this->getFunctionAndMethodSet() as $function_or_method) {
if ($function_or_method->isPHPInternal()) {
Method getUnionTypeRepresentationForIssue
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getUnionTypeRepresentationForIssue(): string
{
$union_type = $this->getNonVariadicUnionType()->asNormalizedTypes();
if ($union_type->isEmpty()) {
return '';
Method importParentClass
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function importParentClass(CodeBase $code_base): void
{
if (!$this->isFirstExecution(__METHOD__)) {
return;
}
Method importTraitAdaptations
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function importTraitAdaptations(
CodeBase $code_base,
Clazz $class,
TraitAdaptations $trait_adaptations,
Option $type_option
Method getAncestorElement
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getAncestorElement(CodeBase $code_base, FullyQualifiedClassName $ancestor_fqsen, ClassElement $element): ?ClassElement
{
if (!$code_base->hasClassWithFQSEN($ancestor_fqsen)) {
return null;
}
Method emitWrongInheritanceCategoryWarning
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function emitWrongInheritanceCategoryWarning(
CodeBase $code_base,
Clazz $ancestor,
string $expected_inheritance_category,
int $lineno
Method isAccessibleFromClass
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function isAccessibleFromClass(CodeBase $code_base, ?FullyQualifiedClassName $accessing_class_fqsen): bool
{
if ($this->isPublic()) {
return true;
}
Method parseMixin
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function parseMixin(int $i, string $line, string $annotation_name): void
{
if (!Config::getValue('read_mixin_annotations')) {
return;
}
Method defaultConstructorForClass
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function defaultConstructorForClass(
Clazz $clazz,
CodeBase $code_base
): Method {
if ($clazz->getFQSEN()->getNamespace() === '\\' && $clazz->hasMethodWithName($code_base, $clazz->getName(), true)) {
Method getOverriddenMethods
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getOverriddenMethods(
CodeBase $code_base
): array {
// Get the class that defines this method
$class = $this->getClass($code_base);
Method getTemplateTypeExtractorClosure
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getTemplateTypeExtractorClosure(CodeBase $code_base, TemplateType $template_type, int $skip_index = null): ?Closure
{
$closure = null;
foreach ($this->parameter_list as $i => $parameter) {
if ($i === $skip_index) {
Method canCastToGenericArrayKeys
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function canCastToGenericArrayKeys(GenericArrayType $type, bool $ignore_config = false): bool
{
if ($type instanceof ListType) {
$i = 0;
$has_possibly_undefined = false;
Method withFlattenedArrayShapeTypeInstancesForSet
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function withFlattenedArrayShapeTypeInstancesForSet(array $type_set): array
{
$result = [];
$has_other_array_type = false;
$empty_array_shape_type = null;
Method visitStmtList
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitStmtList(Node $node): Context
{
$context = $this->context;
$plugin_set = ConfigPluginSet::instance();
$plugin_set->preAnalyzeNode(
Method visitArray
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitArray(Node $node): Context
{
$context = $this->context;
$context->setLineNumberStart($node->lineno);
Method visitIfElem
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitIfElem(Node $node): Context
{
$context = $this->context->withLineNumberStart(
$node->lineno
);