| 1 | package BackPAN::Index::Create::OrderBy::Author; | ||||||||||||||||||||||||||||
| 2 | 2 | $BackPAN::Index::Create::OrderBy::Author::VERSION = '0.13'; | |||||||||||||||||||||||||||
| 3 | 2 | ▶ | use Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use CPAN::DistnameInfo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 2 | has filehandle => (is => 'ro'); | |||||||||||||||||||||||||||
| 7 | 2 | ▶ | has entries => (is => 'ro', default => sub { return {} }); | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | sub add_file | ||||||||||||||||||||||||||||
| 10 | 4 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
add_file: called CC=3 SCAR=11.7
Pod
undocumented
| |||||||||||||||||||||||||||||
| 11 | 4 | my $self = shift; | |||||||||||||||||||||||||||
| 12 | 4 | my ($path, $time, $size) = @_; | |||||||||||||||||||||||||||
| 13 | 4 | my $distinfo = CPAN::DistnameInfo->new($path); | |||||||||||||||||||||||||||
| 14 | 4 | my $entries = $self->entries; | |||||||||||||||||||||||||||
| 15 | 4 | my $author; | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 4 | ▶ | if (!defined($distinfo) || !defined($author = $distinfo->cpanid)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $distinfo and defined($author = $distinfo->cpanid)
MC/DC0%0/2
defined $distinfo and defined($author = $distinfo->cpanid)
defined $distinfo
defined($author = $distinfo->cpanid)
Truth table33%1/3
A and B
A= defined $distinfoB= defined($author = $distinfo->cpanid)
| |||||||||||||||||||||||||||||
| 18 | 0 | $author = ''; | |||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||
| 20 | 4 | push(@{ $entries->{$author} }, [$path,$time,$size] ); | |||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | sub finish | ||||||||||||||||||||||||||||
| 24 | 2 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
finish: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 25 | 2 | my $self = shift; | |||||||||||||||||||||||||||
| 26 | 2 | my $entries = $self->entries; | |||||||||||||||||||||||||||
| 27 | 2 | my $fh = $self->filehandle; | |||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 2 | foreach my $author (sort { lc($a) cmp lc($b) } keys %$entries) { | |||||||||||||||||||||||||||
| 30 | 0 | foreach my $entry (sort { $a->[1] <=> $b->[1] } | |||||||||||||||||||||||||||
| 31 | 4 | @{ $entries->{$author} }) { | |||||||||||||||||||||||||||
| 32 | 4 | printf $fh "%s %d %d\n", @$entry; | |||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 2 | 1; | |||||||||||||||||||||||||||