Showing 3,272 of 4,939 total issues
Method visitDoWhile
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitDoWhile(Node $node): Context
{
$context = $this->context;
$context->setLineNumberStart($node->lineno);
$context = $context->withEnterLoop($node);
Method beforeAnalyze
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function beforeAnalyze(CodeBase $code_base): void
{
self::addMissingNamespacesToTypes($code_base);
$code_base->eagerlyLoadAllSignatures();
Method addTypesToPropertyStandalone
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function addTypesToPropertyStandalone(
CodeBase $code_base,
Context $context,
Property $property,
UnionType $new_types
Method analyzePropertyAssignmentStrict
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function analyzePropertyAssignmentStrict(Property $property, UnionType $assignment_type, Node $node): void
{
$type_set = $assignment_type->getTypeSet();
if (\count($type_set) < 2) {
throw new AssertionError('Expected to have at least two types when checking if types match in strict mode');
Method visit
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visit(Node $node): UnionType
{
$left = UnionTypeVisitor::unionTypeFromNode(
$this->code_base,
$this->context,
Method checkComplexNegatedEmpty
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function checkComplexNegatedEmpty(Node $var_node): Context
{
$context = $this->context;
// TODO: !empty($obj->prop['offset']) should imply $obj is not null (removeNullFromVariable)
if ($var_node->kind === ast\AST_DIM) {
Method visitPrint
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitPrint(Node $node): Context
{
$code_base = $this->code_base;
$context = $this->context;
$expr_node = $node->children['expr'];
Method getVariableName
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getVariableName(): string
{
if (!($this->node instanceof Node)) {
return (string)$this->node;
}
Method functionLikeListFromNodeAndContext
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function functionLikeListFromNodeAndContext(CodeBase $code_base, Context $context, $node, bool $log_error): array
{
try {
$function_fqsens = (new UnionTypeVisitor($code_base, $context, true))->functionLikeFQSENListFromNode($node);
} catch (FQSENException $e) {
Method getAvailableConstantPHPDocSummaries
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function getAvailableConstantPHPDocSummaries(): array
{
return $this->memoize(__METHOD__, /** @return array<string,string> */ function (): array {
$code_base = $this->code_base;
$map = [];
Method analyzeTemporaryDirectory
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function analyzeTemporaryDirectory(int $i, array $new_tokens_for_files)
{
$tmp_dir = self::$basename . "/tmp/mutate$i";
mkdir("$tmp_dir/.phan", 0766, true);
mkdir("$tmp_dir/src", 0766, true);
Method arrayTypeFromFlags
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function arrayTypeFromFlags(array $flag_set): UnionType
{
// 1. Convert key types from opcache to Phan's representation
if (isset($flag_set['MAY_BE_ARRAY_KEY_ANY'])) {
$key_type = GenericArrayType::KEY_MIXED;
Method getAvailableConstantPHPDocSummaries
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function getAvailableConstantPHPDocSummaries(): array
{
return $this->memoize(__METHOD__, /** @return array<string,string> */ function (): array {
$code_base = $this->code_base;
$map = [];
Method visitIf
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitIf(Node $node): void
{
if (count($node->children) <= 1) {
// There can't be any duplicates.
return;
Method visitConditional
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitConditional(Node $node): void
{
$cond_node = $node->children['cond'];
$true_node_hash = ASTHasher::hash($node->children['true']);
Method toStubInfo
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function toStubInfo(CodeBase $code_base): array
{
$signature = $this->toStubSignature($code_base);
$stub = $signature;
Method locateNamespaceUseDefinition
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function locateNamespaceUseDefinition(GoToDefinitionRequest $request, CodeBase $code_base, Node $node): void
{
// TODO: Support GroupUse (See ScopeVisitor->visitGroupUse)
$targets = ScopeVisitor::aliasTargetMapFromUseNode($node);
if (count($targets) !== 1) {
Method getNamespaceMapFor
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getNamespaceMapFor(
int $flags,
string $name
): FullyQualifiedGlobalStructuralElement {
Method visitStaticCall
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitStaticCall(Node $node): void
{
[$parent, $used] = $this->findNonUnaryParentNode($node);
if (!$parent) {
//fwrite(STDERR, "No parent in " . __METHOD__ . "\n");
Method wrapNArgumentFunction
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function wrapNArgumentFunction(
string $function_name,
int $min_args,
?int $max_args = null
): Closure {