Branch Coverage

blib/lib/Mirror/JSON.pm
Criterion Covered Total %
branch 14 46 30.4


line true false branch
33 1 0 if (_STRING($$self{'uri'}))
36 1 0 if (_STRING($$self{'timestamp'}) and not _POSINT($$self{'timestamp'}))
37 0 1 unless ($$self{'timestamp'} =~ /^(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)Z$/)
42 0 1 unless (_ARRAY0($$self{'mirrors'}))
46 1 0 if (_STRING($$_{'uri'}))
48 0 1 unless $_ = 'Mirror::JSON::URI'->new(%$_)
61 0 1 unless open MIRROR, $file
63 0 1 unless close MIRROR
76 0 0 unless my $file = shift()
79 0 0 unless open CFG, '>' . $file
93 0 0 if (defined $$hash{'source'})
119 1 0 unless $_[0]{'age'}
140 1 1 if defined $$mirror{'live'}
160 0 0 if ($self->age < 2592000)
168 0 0 if $_->age >= 0
170 0 0 unless (scalar @uris <= 2 and $uris[0] and $uris[0] >= scalar($self->mirrors) - 1)
177 0 0 unless my $new_uri = 'Mirror::JSON::URI'->new('uri', 'URI'->new($uris[0]))
180 0 0 unless $new_uri->get
184 0 0 unless my $new = $new_uri->json
187 0 0 if ($old{$_->uri}) { }
217 0 1 if (@ideal >= $wanted)
223 0 1 if (@current >= $wanted)
228 0 1 if (@current)