line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Toolforge::MixNMatch::Struct::Catalog; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
340245
|
use strict; |
|
4
|
|
|
|
|
36
|
|
|
4
|
|
|
|
|
120
|
|
4
|
4
|
|
|
4
|
|
22
|
use warnings; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
100
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
1722
|
use Toolforge::MixNMatch::Struct::User; |
|
4
|
|
|
|
|
14
|
|
|
4
|
|
|
|
|
122
|
|
7
|
4
|
|
|
4
|
|
1749
|
use Toolforge::MixNMatch::Struct::YearMonth; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
118
|
|
8
|
4
|
|
|
4
|
|
1471
|
use Toolforge::MixNMatch::Object::Catalog; |
|
4
|
|
|
|
|
4561
|
|
|
4
|
|
|
|
|
1226
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = 0.03; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub obj2struct { |
13
|
2
|
|
|
2
|
0
|
1925
|
my $obj = shift; |
14
|
|
|
|
|
|
|
|
15
|
2
|
|
|
|
|
9
|
my $struct_hr = { |
16
|
|
|
|
|
|
|
'type' => [{ |
17
|
|
|
|
|
|
|
'type' => $obj->type, |
18
|
|
|
|
|
|
|
'cnt' => $obj->count, |
19
|
|
|
|
|
|
|
}], |
20
|
|
|
|
|
|
|
'user' => [], |
21
|
|
|
|
|
|
|
'ym' => [], |
22
|
|
|
|
|
|
|
}; |
23
|
2
|
|
|
|
|
35
|
foreach my $year_month (@{$obj->year_months}) { |
|
2
|
|
|
|
|
5
|
|
24
|
2
|
|
|
|
|
12
|
push @{$struct_hr->{'ym'}}, |
|
2
|
|
|
|
|
8
|
|
25
|
|
|
|
|
|
|
Toolforge::MixNMatch::Struct::YearMonth::obj2struct($year_month); |
26
|
|
|
|
|
|
|
} |
27
|
2
|
|
|
|
|
20
|
foreach my $user (@{$obj->users}) { |
|
2
|
|
|
|
|
5
|
|
28
|
2
|
|
|
|
|
10
|
push @{$struct_hr->{'user'}}, |
|
2
|
|
|
|
|
6
|
|
29
|
|
|
|
|
|
|
Toolforge::MixNMatch::Struct::User::obj2struct($user); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
2
|
|
|
|
|
16
|
return $struct_hr; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub struct2obj { |
36
|
2
|
|
|
2
|
0
|
2986
|
my $struct_hr = shift; |
37
|
|
|
|
|
|
|
|
38
|
2
|
|
|
|
|
5
|
my $year_months = []; |
39
|
2
|
|
|
|
|
4
|
foreach my $year_month_hr (@{$struct_hr->{'ym'}}) { |
|
2
|
|
|
|
|
6
|
|
40
|
2
|
|
|
|
|
4
|
push @{$year_months}, Toolforge::MixNMatch::Struct::YearMonth::struct2obj($year_month_hr); |
|
2
|
|
|
|
|
8
|
|
41
|
|
|
|
|
|
|
} |
42
|
2
|
|
|
|
|
5
|
my $users = []; |
43
|
2
|
|
|
|
|
4
|
foreach my $user_hr (@{$struct_hr->{'user'}}) { |
|
2
|
|
|
|
|
5
|
|
44
|
2
|
|
|
|
|
4
|
push @{$users}, Toolforge::MixNMatch::Struct::User::struct2obj($user_hr); |
|
2
|
|
|
|
|
8
|
|
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
my $obj = Toolforge::MixNMatch::Object::Catalog->new( |
47
|
|
|
|
|
|
|
'count' => $struct_hr->{'type'}->[0]->{'cnt'}, |
48
|
2
|
|
|
|
|
16
|
'type' => $struct_hr->{'type'}->[0]->{'type'}, |
49
|
|
|
|
|
|
|
'users' => $users, |
50
|
|
|
|
|
|
|
'year_months' => $year_months, |
51
|
|
|
|
|
|
|
); |
52
|
|
|
|
|
|
|
|
53
|
2
|
|
|
|
|
220
|
return $obj; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |