Showing 3,272 of 4,939 total issues
Method findVariableReuse
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function findVariableReuse(array $variables): void
{
if (!$variables) {
return;
}
Method visitFuncDecl
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitFuncDecl(Node $node): Context
{
$function_name = (string)$node->children['name'];
$context = $this->context;
$code_base = $this->code_base;
Method updateVariableWithNewType
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
final protected function updateVariableWithNewType(
Node $var_node,
Context $context,
UnionType $new_union_type,
bool $suppress_issues,
Method print
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function print(IssueInstance $instance): void
{
$issue = $instance->getIssue();
$message = HTML::htmlTemplate(
$issue->getTemplateRaw(),
Method analyzeAbstractMethodsAreImplemented
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function analyzeAbstractMethodsAreImplemented(
CodeBase $code_base,
Clazz $class
): void {
// Don't worry about internal classes
Method analyzeFunction
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function analyzeFunction(
CodeBase $code_base,
Func $function
): void {
if ($function->isPHPInternal()) {
Method visitIf
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitIf(Node $node): Context
{
// Here, we visit the group of if/elseif/else instead of the individuals (visitIfElem)
// so that we have the Union types of the variables **before** the PreOrderAnalysisVisitor makes inferences
foreach ($node->children as $if_node) {
Method analyzeFunctionLike
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function analyzeFunctionLike(CodeBase $code_base, FunctionInterface $method): void
{
if (Phan::isExcludedAnalysisFile($method->getContext()->getFile())) {
// This has no side effects, so we can skip files that don't need to be analyzed
return;
Method tokenizeRegexParts
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function tokenizeRegexParts(string $inner): Generator
{
$inner_len = strlen($inner);
for ($j = 0; $j < $inner_len;) {
switch ($c = $inner[$j]) {
Method outputProgressLine
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function outputProgressLine(string $msg, float $p, float $memory, float $peak, ?int $offset = null, ?int $count = null): void
{
if (self::shouldShowLongProgress()) {
self::showLongProgress($msg, $p, $memory, $offset, $count);
return;
Method setMagicPropertyMap
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function setMagicPropertyMap(
array $magic_property_map,
CodeBase $code_base
): bool {
if (count($magic_property_map) === 0) {
Method getSettersMap
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getSettersMap(CodeBase $code_base): array
{
return $this->memoize(
__METHOD__,
/**
Method magicParamFromMagicMethodParamString
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function magicParamFromMagicMethodParamString(
string $param_string,
int $param_index,
int $comment_line_offset
): ?Parameter {
Method mergeMethodParts
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function mergeMethodParts(array $parts): array
{
$prev_parts = [];
$delta = 0;
$results = [];
Method returnTypeFromCommentLine
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function returnTypeFromCommentLine(
string $line,
int $i
): UnionType {
$return_union_type_string = '';
Method fromStringInContext
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function fromStringInContext(
string $fqsen_string,
Context $context
) {
// Check to see if we're fully qualified
Method mergeTypeParts
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function mergeTypeParts(array $parts): array
{
$prev_parts = [];
$delta = 0;
$results = [];
Method canPossiblyCastToClass
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function canPossiblyCastToClass(CodeBase $code_base, Type $other): bool
{
if (!$this->isPossiblyObject()) {
return false;
}
Method analyzeAndGetUpdatedContextAndAssertTruthy
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function analyzeAndGetUpdatedContextAndAssertTruthy(
Context $context,
Node $parent_node,
$condition_node
): Context {
Method visitIf
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitIf(Node $node): VariableTrackingScope
{
$outer_scope = $this->scope;
$inner_scope_list = [];