Showing 3,272 of 4,939 total issues
Method preAnalyzeIfElemCondition
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function preAnalyzeIfElemCondition(Node $if_elem_node, Context $fallthrough_context): array
{
$condition_node = $if_elem_node->children['cond'];
if ($condition_node instanceof Node) {
if ($condition_node->kind === ast\AST_BINARY_OP) {
Method warnAboutNonTraversableType
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function warnAboutNonTraversableType(Node $node, Type $type): void
{
$fqsen = FullyQualifiedClassName::fromType($type);
if (!$this->code_base->hasClassWithFQSEN($fqsen)) {
return;
Method visitMethodCall
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitMethodCall(Node $node): void
{
$context = $this->context;
if (!$context->isInFunctionLikeScope()) {
return;
Method visitStaticCall
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitStaticCall(Node $node): void
{
$context = $this->context;
if (!$context->isInFunctionLikeScope()) {
return;
Method mergeBranchScopeList
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function mergeBranchScopeList(
array $branch_scopes,
bool $merge_parent_scope,
array $inner_exiting_scope_list
): VariableTrackingScope {
Method addDefaultPropertiesOfThisToContext
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function addDefaultPropertiesOfThisToContext(Clazz $class, Context $context): void
{
$property_types = [];
foreach ($class->getPropertyMap($this->code_base) as $property) {
if ($property->isDynamicOrFromPHPDoc()) {
Method removeTypesNotSupportingAccessFromVariable
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
final protected function removeTypesNotSupportingAccessFromVariable(Node $var_node, Context $context, int $access_type): Context
{
return $this->updateVariableWithConditionalFilter(
$var_node,
$context,
Method maybeWarnWriteOnlyProperty
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function maybeWarnWriteOnlyProperty(CodeBase $code_base, Property $property): void
{
if ($property->isWriteOnly()) {
// Handle annotations such as property-write and phan-write-only
return;
Method maybeWarnReadOnlyProperty
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function maybeWarnReadOnlyProperty(CodeBase $code_base, Property $property): void
{
if ($property->isReadOnly()) {
// Handle annotations such as property-read and phan-read-only.
return;
Method updateVariableWithConditionalFilter
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
final protected function updateVariableWithConditionalFilter(
Node $var_node,
Context $context,
Closure $should_filter_cb,
Closure $filter_union_type_cb,
Method maybeWarnSameNamespaceUse
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function maybeWarnSameNamespaceUse(string $alias, FullyQualifiedGlobalStructuralElement $target, int $flags, int $lineno): void
{
if (\strcasecmp($alias, $target->getName()) !== 0) {
return;
}
Method analyzeBinaryNumericOp
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function analyzeBinaryNumericOp(Node $node): void
{
$left = UnionTypeVisitor::unionTypeFromNode(
$this->code_base,
$this->context,
Method phpParserExprListToExprList
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function phpParserExprListToExprList(PhpParser\Node\DelimitedList\ExpressionList $expressions_list, int $lineno): ast\Node
{
$children = [];
$expressions_children = $expressions_list->children;
foreach ($expressions_children as $expr) {
Method visitClassNameNode
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function visitClassNameNode(Node $node): ?UnionType
{
// Things of the form `new $className()`, `new $obj()`, `new (foo())()`, etc.
if ($node->kind !== \ast\AST_NAME) {
return null;
Method classListFromNode
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function classListFromNode(Node $node): \Generator
{
// Get the types associated with the node
$union_type = self::unionTypeFromNode(
$this->code_base,
Method getAvailablePropertyPHPDocSummaries
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function getAvailablePropertyPHPDocSummaries(): array
{
return $this->memoize(__METHOD__, /** @return array<string,string> */ function (): array {
$map = [];
foreach ($this->getClassXMLFiles() as $xml) {
Method finalizeProcess
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function finalizeProcess(CodeBase $code_base): void
{
echo "<" . "?php declare(strict_types=1);\n";
ksort(self::$calls);
foreach (self::$calls as $namespace => $name_set) {
Method processVariable
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function processVariable(File $phpcs_file, $stack_ptr)
{
if ($this->isExcluded($phpcs_file)) {
return;
}
Method analyzeClass
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function analyzeClass(
CodeBase $code_base,
Clazz $class
): void {
if ($class->isAnonymous()) {
Method read
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function read(): bool
{
if ($this->done) {
return true;
}