line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Toolforge::MixNMatch::Print::Catalog; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
265264
|
use strict; |
|
3
|
|
|
|
|
30
|
|
|
3
|
|
|
|
|
89
|
|
4
|
3
|
|
|
3
|
|
18
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
69
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
1511
|
use Indent; |
|
3
|
|
|
|
|
80110
|
|
|
3
|
|
|
|
|
121
|
|
7
|
3
|
|
|
3
|
|
1391
|
use Toolforge::MixNMatch::Print::User; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
93
|
|
8
|
3
|
|
|
3
|
|
1280
|
use Toolforge::MixNMatch::Print::YearMonth; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
1090
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = 0.02; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub print { |
13
|
4
|
|
|
4
|
0
|
2924
|
my ($obj, $opts_hr) = @_; |
14
|
|
|
|
|
|
|
|
15
|
4
|
50
|
|
|
|
13
|
if (! defined $opts_hr) { |
16
|
4
|
|
|
|
|
13
|
$opts_hr = { |
17
|
|
|
|
|
|
|
'type' => 1, |
18
|
|
|
|
|
|
|
'count' => 1, |
19
|
|
|
|
|
|
|
'year_months' => 1, |
20
|
|
|
|
|
|
|
'users' => 1, |
21
|
|
|
|
|
|
|
}; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
my @print = ( |
25
|
|
|
|
|
|
|
$opts_hr->{'type'} ? 'Type: '.$obj->type : (), |
26
|
4
|
50
|
|
|
|
18
|
$opts_hr->{'count'} ? 'Count: '.$obj->count : (), |
|
|
50
|
|
|
|
|
|
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
4
|
|
|
|
|
73
|
my $i; |
30
|
|
|
|
|
|
|
|
31
|
4
|
100
|
66
|
|
|
14
|
if ($opts_hr->{'year_months'} && @{$obj->year_months}) { |
|
4
|
|
|
|
|
10
|
|
32
|
2
|
|
33
|
|
|
29
|
$i //= Indent->new; |
33
|
2
|
|
|
|
|
46
|
push @print, 'Year/months:'; |
34
|
2
|
|
|
|
|
7
|
$i->add; |
35
|
2
|
0
|
|
|
|
17
|
foreach my $year_month (sort { $a->year <=> $b->year || $a->month <=> $b->month } |
|
2
|
|
|
|
|
21
|
|
36
|
2
|
|
|
|
|
5
|
@{$obj->year_months}) { |
37
|
|
|
|
|
|
|
|
38
|
4
|
|
|
|
|
51
|
push @print, $i->get.Toolforge::MixNMatch::Print::YearMonth::print($year_month); |
39
|
|
|
|
|
|
|
} |
40
|
2
|
|
|
|
|
6
|
$i->remove; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
4
|
100
|
66
|
|
|
56
|
if ($opts_hr->{'users'} && @{$obj->users}) { |
|
4
|
|
|
|
|
11
|
|
44
|
2
|
|
66
|
|
|
30
|
$i //= Indent->new; |
45
|
2
|
|
|
|
|
40
|
push @print, 'Users:'; |
46
|
2
|
|
|
|
|
9
|
$i->add; |
47
|
2
|
|
|
|
|
18
|
foreach my $user (reverse sort { $a->count <=> $b->count } @{$obj->users}) { |
|
2
|
|
|
|
|
22
|
|
|
2
|
|
|
|
|
6
|
|
48
|
4
|
|
|
|
|
31
|
push @print, $i->get.Toolforge::MixNMatch::Print::User::print($user); |
49
|
|
|
|
|
|
|
} |
50
|
2
|
|
|
|
|
7
|
$i->remove; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
4
|
50
|
|
|
|
72
|
return wantarray ? @print : (join "\n", @print); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |