Branch Coverage

blib/lib/CloudPAN.pm
Criterion Covered Total %
branch 18 28 64.2


line true false branch
21 2 1 unless $opt
22 0 1 unless ref $opt eq 'HASH'
25 1 0 if (exists $$opt{'persistence_location'}) { }
31 0 1 if (@$err)
61 0 4 unless $ret and exists $$ret{'hits'} and exists $$ret{'hits'}{'hits'} and ref $$ret{'hits'}{'hits'} eq 'ARRAY' and scalar @{$$ret{'hits'}{'hits'};} and exists $$ret{'hits'}{'hits'}[0]{'fields'} and exists $$ret{'hits'}{'hits'}[0]{'fields'}{'author'} and exists $$ret{'hits'}{'hits'}[0]{'fields'}{'release'} and exists $$ret{'hits'}{'hits'}[0]{'fields'}{'path'}
73 0 4 unless $$response{'success'} and length $$response{'content'}
80 2 4 unless (eval { do { my $ret = $api->fetch('module/_search', 'q', "path:lib/$name AND status:latest", 'size', 1, 'fields', 'author,release,path'); die 'NoFetch' unless $ret and exists $$ret{'hits'} and exists $$ret{'hits'}{'hits'} and ref $$ret{'hits'}{'hits'} eq 'ARRAY' and scalar @{$$ret{'hits'}{'hits'};} and exists $$ret{'hits'}{'hits'}[0]{'fields'} and exists $$ret{'hits'}{'hits'}[0]{'fields'}{'author'} and exists $$ret{'hits'}{'hits'}[0]{'fields'}{'release'} and exists $$ret{'hits'}{'hits'}[0]{'fields'}{'path'}; my $fields = $$ret{'hits'}{'hits'}[0]{'fields'}; my $req_url = join('/', $$api{'base_url'}, 'source', @{$fields;}{'author', 'release', 'path'}); my $response = $$api{'ua'}->get($req_url); die 'HTTP' unless $$response{'success'} and length $$response{'content'}; $content = $$response{'content'} } })
81 0 2 if ("$@" eq 'NoFetch') { }
0 2 elsif ("$@" eq 'HTTP') { }
99 4 3 if (exists $$options{'location'}) { }
102 1 3 if (-e $path) { }
104 0 1 unless open my $fh, '<', $path
116 0 3 if (@$err)
122 0 3 unless open my $fh, '+>', $path