use base ("Understand::IReport"); sub name { return "Variable Initialization"; } sub test_entity { my $entity = shift; return $entity->kind->check("function") ? 1 : -1; } sub test_global { return -1; } sub init { my $report = shift; } sub generate { my $report = shift; my $entity = shift; my %seen = (); print_set_refs($report, \%seen, $entity); } sub print_set_refs { my $report = shift; my $seen = shift; my $function = shift; $seen->{$function->id}++; foreach my $ref ($function->refs("set", "~local")) { $report->syncfile($ref->file, $ref->line, 0); $report->print($ref->kind->name); $report->print(" "); $report->entity($ref->ent); $report->fontcolor("blue"); $report->print($ref->ent->longname); $report->fontcolor("black"); $report->entity; $report->print("\n"); $report->syncfile; } foreach my $call ($function->ents("call")) { if (!$seen->{$call->id}) { print_set_refs($report, $seen, $call); } } }