Showing 3,272 of 4,939 total issues
Method adaptInheritedMethodFromTrait
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function adaptInheritedMethodFromTrait(Method $method): Method
{
$method_flags = $method->getFlags();
if (Flags::bitVectorHasState($method_flags, \ast\flags\MODIFIER_PRIVATE)) {
$method = $method->createUseAlias($this, $method->getName(), \ast\flags\MODIFIER_PRIVATE);
Method typeStringComponentsInner
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function typeStringComponentsInner(
string $type_string
): Tuple5 {
// Check to see if we have template parameter types
$template_parameter_type_name_list = [];
Method visitConditional
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitConditional(Node $node): Context
{
$context = $this->context->withLineNumberStart(
$node->lineno
);
Method analyzeSubstituteVarAssert
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function analyzeSubstituteVarAssert(CodeBase $code_base, Context $context, string $text): void
{
$has_known_annotations = false;
if (\preg_match_all(self::PHAN_VAR_REGEX, $text, $matches, \PREG_SET_ORDER) > 0) {
$has_known_annotations = true;
Method visitTry
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitTry(Node $node): Context
{
$context = $this->context->withLineNumberStart(
$node->lineno
);
Method phan_error_handler
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function phan_error_handler(int $errno, string $errstr, string $errfile, int $errline): bool
{
global $__no_echo_phan_errors;
if ($__no_echo_phan_errors) {
if ($__no_echo_phan_errors instanceof Closure) {
Method print
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function print(IssueInstance $instance): void
{
$file = $instance->getDisplayedFile();
$line = $instance->getLine();
$issue = $instance->getIssue();
Method checkRedundantOrImpossibleTruthyCondition
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function checkRedundantOrImpossibleTruthyCondition($node, Context $context, ?UnionType $type, bool $is_negated): void
{
if ($node instanceof Node) {
// Here, we only perform the redundant condition checks on whichever ran first, to avoid warning about both impossible and redundant conditions
if (isset($node->did_check_redundant_condition)) {
Method extractDocComment
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function extractDocComment(string $doc_comment, int $comment_category = null, UnionType $element_type = null, bool $remove_type = false): string
{
// Trim the start and the end of the doc comment.
//
// We leave in the second `*` of `/**` so that every single non-empty line
Method analyzeBinaryCoalesceForRedundantCondition
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function analyzeBinaryCoalesceForRedundantCondition(Context $context, Node $node): void
{
$left_node = $node->children['left'];
$right_node = $node->children['right'];
// @phan-suppress-next-line PhanPartialTypeMismatchArgumentInternal, PhanPossiblyUndeclaredProperty
Method visitBinaryOp
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitBinaryOp(Node $node): void
{
$flags = $node->flags;
if (!\array_key_exists($flags, self::REDUNDANT_BINARY_OP_SET)) {
// Nothing to warn about
Method isRedundantFunctionComment
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function isRedundantFunctionComment(FunctionInterface $method, string $doc_comment): bool
{
$lines = explode("\n", $doc_comment);
foreach ($lines as $line) {
$line = trim($line, " \r\n\t*/");
File extract_arg_info.php
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
#!/usr/bin/env php
<?php
declare(strict_types=1);
Method getShortRepresentationForIssue
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getShortRepresentationForIssue(bool $is_internal = false): string
{
$string = '';
$union_type_string = $this->getUnionTypeRepresentationForIssue();
Method suggestVariableTypoFix
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function suggestVariableTypoFix(CodeBase $code_base, Context $context, string $variable_name, string $prefix = 'Did you mean'): ?Suggestion
{
if (Config::getValue('disable_suggestions')) {
return null;
}
Method checkCanIterate
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function checkCanIterate(UnionType $union_type, Node $node): void
{
if ($union_type->isEmpty()) {
return;
}
Method visitInstanceof
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitInstanceof(Node $node): void
{
$expr_node = $node->children['expr'];
$code_base = $this->code_base;
try {
Method visitStaticProp
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitStaticProp(Node $node): Context
{
$property_name = $node->children['prop'];
// Things like self::${$x}
Method computeTypeSetOfMergedArrayShapeTypes
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function computeTypeSetOfMergedArrayShapeTypes(array $old_type_set, array $new_type_set, int $dim_depth, bool $is_real): array
{
if ($is_real) {
if (!$old_type_set || !$new_type_set) {
return [];
Method visitFuncDecl
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitFuncDecl(Node $node): Context
{
$function_name = (string)$node->children['name'];
$code_base = $this->code_base;
$original_context = $this->context;