line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPAN::Cover::Results::ReleaseIterator; |
2
|
|
|
|
|
|
|
$CPAN::Cover::Results::ReleaseIterator::VERSION = '0.02'; |
3
|
1
|
|
|
1
|
|
917
|
use Moo; |
|
1
|
|
|
|
|
18263
|
|
|
1
|
|
|
|
|
7
|
|
4
|
1
|
|
|
1
|
|
2798
|
use autodie; |
|
1
|
|
|
|
|
20810
|
|
|
1
|
|
|
|
|
8
|
|
5
|
1
|
|
|
1
|
|
8528
|
use JSON qw/ decode_json /; |
|
1
|
|
|
|
|
19397
|
|
|
1
|
|
|
|
|
1369
|
|
6
|
1
|
|
|
1
|
|
172
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
68
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
684
|
use CPAN::Cover::Results::Release; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
476
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has 'results' => ( is => 'ro' ); |
11
|
|
|
|
|
|
|
has '_results_data' => ( is => 'lazy' ); |
12
|
|
|
|
|
|
|
has '_keys' => ( is => 'lazy' ); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub _build__results_data |
15
|
|
|
|
|
|
|
{ |
16
|
0
|
|
|
0
|
|
|
my $self = shift; |
17
|
0
|
|
|
|
|
|
my $fh = $self->results->open_file(); |
18
|
0
|
|
|
|
|
|
local $/; |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
my $json_text = <$fh>; |
21
|
0
|
|
|
|
|
|
close($fh); |
22
|
0
|
|
|
|
|
|
return decode_json($json_text); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub _build__keys |
26
|
|
|
|
|
|
|
{ |
27
|
0
|
|
|
0
|
|
|
my $self = shift; |
28
|
0
|
|
|
|
|
|
my $results_ref = $self->_results_data; |
29
|
0
|
|
|
|
|
|
my $keypair_listref = []; |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
foreach my $distname (sort { lc($a) cmp lc($b) } keys %$results_ref) { |
|
0
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
foreach my $version (sort keys %{ $results_ref->{$distname} }) { |
|
0
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
push(@$keypair_listref, [$distname, $version]); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
return $keypair_listref; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub next |
41
|
|
|
|
|
|
|
{ |
42
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
43
|
0
|
|
|
|
|
|
my $data_ref = $self->_results_data; |
44
|
0
|
|
|
|
|
|
my $keypair_listref = $self->_keys; |
45
|
|
|
|
|
|
|
|
46
|
0
|
0
|
|
|
|
|
return undef unless @$keypair_listref > 0; |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
my $keypair = shift @$keypair_listref; |
49
|
0
|
|
|
|
|
|
my ($distname, $version) = @$keypair; |
50
|
0
|
|
|
|
|
|
my $result_record = { |
51
|
|
|
|
|
|
|
distname => $distname, |
52
|
|
|
|
|
|
|
version => $version, |
53
|
0
|
|
|
|
|
|
%{ $data_ref->{$distname}->{$version}->{coverage}->{total} }, |
54
|
|
|
|
|
|
|
}; |
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
|
return CPAN::Cover::Results::Release->new($result_record); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
|