Branch Coverage

blib/lib/Yars/Client.pm
Criterion Covered Total %
branch 77 146 52.7


line true false branch
79 3 106 if (defined $tx->res->headers->header('X-Yars-Cache'))
92 0 0 $new ? :
94 0 0 if $caller ne 'Clustericious::Client'
110 19 53 if (defined $new) { }
12 41 elsif (not defined $self->{'bucket_map_cached'}) { }
113 16 3 if (ref $new) { }
122 5 7 if (-r $fn) { }
138 1 4 if (grep {not $r{$_};} $self->config->url, $self->config->failover_urls('default', [])) { }
163 4 0 if $path
169 0 25 unless my $hex = shift()
177 0 0 unless my $b64 = shift()
179 0 0 if ref $b64 eq 'ARRAY'
186 0 0 if $filename =~ /^[0-9a-f]{32}$/i
187 0 0 unless defined $filename
188 0 0 unless $md5
202 0 12 if (@_ == 1)
206 4 8 if $filename =~ /^[0-9a-f]{32}$/i
208 0 0 unless ($md5 or $abs_url)
213 12 0 unless $abs_url
219 8 13 if ($tries > @hosts + 1)
225 0 21 if ($abs_url) { }
228 9 12 if $host > $#hosts
237 11 10 unless (my $res = $tx->success)
240 1 10 if ($error->{'code'})
251 0 10 if ($host == 0)
256 0 0 if ($prev and $prev->code == 301)
261 5 4 ref $dest eq 'SCALAR' ? :
9 1 $dest ? :
266 0 10 if (my $e = $res->headers->header('Content-Encoding')) { }
267 0 0 unless $e eq 'gzip'
275 0 0 $asset->is_file ? :
0 0 unless (gunzip($asset->is_file ? $asset->path : \$asset->slurp, $out_file))
285 0 10 unless ($md5)
289 10 0 if ($verify eq $md5) { }
291 5 5 if (ref $dest eq 'SCALAR')
303 0 0 unless unlink $out_file
311 2 10 unless $success
312 2 10 unless $success
320 0 4 unless $filename and $md5
334 0 36 unless my $md5 = shift()
336 0 27 unless ($bucket_map and ref $bucket_map eq 'HASH' and keys %$bucket_map > 0)
337 0 9 unless $bucket_map = $self->bucket_map
338 9 0 if $bucket_map and ref $bucket_map and keys %$bucket_map > 0
340 0 36 unless ($bucket_map and ref $bucket_map and keys %$bucket_map > 0)
346 32 40 if exists $$bucket_map{lc $prefix}
347 4 36 if exists $$bucket_map{uc $prefix}
364 2 0 $tx->success ? :
382 16 4 ref $_[-1] eq 'SCALAR' ? :
399 0 20 if (defined $_[0] and $_[0] eq '--nostash')
406 2 18 defined $_[0] && $_[0] =~ /^[0-9a-f]+$/i ? :
408 0 20 if (@_)
412 0 20 unless $filename
413 16 4 if (defined $content) { }
424 0 20 unless -r $filename
442 0 23 $nostash ? :
457 4 19 unless ($tx->success)
459 4 0 if ref $error
464 1 19 unless $code and $tx->res->is_success
483 0 2 unless $status eq 'ok'
490 1 1 if (my $location = $args{'location'})
492 0 1 unless (my $res = $tx->success)
499 0 1 unless my $md5 = $args{'md5'}
500 0 1 unless my $name = $args{'name'}
506 0 1 unless my $res = $self->res
507 0 1 if (my $b64 = $res->headers->header('Content-MD5'))
510 1 0 if (my $location = $res->headers->location)
524 0 0 if (/^-c$/)
525 0 0 if (/^--show_corrupt$/)
528 0 0 unless $manifest
529 0 0 unless -e $manifest
532 0 0 unless $self->tx->success
533 0 0 @{$got->{'missing'};} == 0 ? :
534 0 0 if $check