Showing 3,272 of 4,939 total issues
Method extractComparisonDirectionsFromBinaryOp
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function extractComparisonDirectionsFromBinaryOp(Node $cond_node, bool $negate): array
{
['left' => $left_node, 'right' => $right_node] = $cond_node->children;
switch ($cond_node->flags) {
case flags\BINARY_IS_SMALLER:
Method extractAutoloadFilesAndDirectories
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function extractAutoloadFilesAndDirectories(string $relative_dir, array $composer_settings): array
{
$directory_list = [];
$file_list = [];
$autoload_setting = $composer_settings['autoload'] ?? [];
Method analyzeParentConstructorCalled
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function analyzeParentConstructorCalled(
CodeBase $code_base,
Clazz $clazz
): void {
// Only look at classes configured to require a call
Method visitBinaryBitwiseXor
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitBinaryBitwiseXor(Node $node): UnionType
{
$left = UnionTypeVisitor::unionTypeFromNode(
$this->code_base,
$this->context,
Method warnNoopNew
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function warnNoopNew(
Node $node,
array $class_list
): void {
$has_constructor_or_destructor = \count($class_list) === 0;
Method arrayTypeFromRealTypeBuilder
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function arrayTypeFromRealTypeBuilder(?UnionTypeBuilder $builder, Node $node, bool $has_key): array
{
// Here, we only check for the real type being an integer.
// Unknown strings such as '0' will cast to integers when used as array keys,
// and if we knew all of the array keys were literals we would have generated an array shape instead.
Method getAvailableMethodPHPDocSummaries
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function getAvailableMethodPHPDocSummaries(): array
{
return $this->memoize(__METHOD__, /** @return array<string,string> */ function (): array {
$method_name_map = [];
$maybe_add_refpurpose = static function (string $name, SimpleXMLElement $xml) use (&$method_name_map): void {
Method visitBinaryOp
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitBinaryOp(Node $node): Context
{
// check every boolean binary operation
if (in_array($node->flags, self::BINARY_BOOL_OPERATORS, true)) {
// get left node and parse it
Method visitBinaryOp
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitBinaryOp(Node $node): void
{
switch ($node->flags) {
case ast\flags\BINARY_IS_EQUAL:
case ast\flags\BINARY_IS_NOT_EQUAL:
Method analyze
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
final public function analyze(CodeBase $code_base): void
{
if ($this->isPHPInternal()) {
return;
}
Method extractTypePartsForStringInContext
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function extractTypePartsForStringInContext(string $type_string): array
{
static $cache = [];
$parts = $cache[$type_string] ?? null;
if (\is_array($parts)) {
Method getSuggestionsForStringSet
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getSuggestionsForStringSet(string $target, array $potential_candidates): array
{
if (count($potential_candidates) === 0) {
return [];
}
Method visitClassConst
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitClassConst(Node $node): void
{
if (!isset($node->tolerant_ast_node)) {
return;
}
Method computeNewContents
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function computeNewContents(string $file, string $contents, array $all_edits): ?string
{
\usort($all_edits, static function (FileEdit $a, FileEdit $b): int {
return ($a->replace_start <=> $b->replace_start)
?: ($a->replace_end <=> $b->replace_end)
Method visitFor
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitFor(Node $node): void
{
$cond_list = $node->children['cond'];
if (!$cond_list instanceof Node) {
return;
Method getTypeMatchingBonus
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getTypeMatchingBonus(CodeBase $code_base, UnionType $actual_signature_type, UnionType $desired_type): float
{
if (self::isMixed($desired_type) || self::isMixed($actual_signature_type)) {
return 0;
}
Method isPHPBinary
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function isPHPBinary(string $relative_path): bool
{
$cwd = \getcwd();
$absolute_path = "$cwd/$relative_path";
if (!\file_exists($absolute_path)) {
Method removeFalseyFromVariable
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
final protected function removeFalseyFromVariable(Node $var_node, Context $context, bool $suppress_issues): Context
{
return $this->updateVariableWithConditionalFilter(
$var_node,
$context,
Method asTypeSupportingAccess
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function asTypeSupportingAccess(UnionType $type, int $access_type): UnionType
{
$type = $type->asMappedListUnionType(/** @return list<Type> */ static function (Type $type) use ($access_type): array {
if ($access_type === ConditionVisitor::ACCESS_IS_OBJECT) {
if (!$type->isPossiblyObject()) {
Method analyzeMethodVisibility
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function analyzeMethodVisibility(
Method $method,
Node $node
): void {
if ($method->isPublic()) {