Branch Coverage

blib/lib/Yars/Client.pm
Criterion Covered Total %
branch 78 148 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'
105 6 0 unless -d $dir
117 19 53 if (defined $new) { }
12 41 elsif (not defined $self->{'bucket_map_cached'}) { }
120 16 3 if (ref $new) { }
129 5 7 if (-r $fn) { }
145 1 4 if (grep {not $r{$_};} $self->config->url, $self->config->failover_urls('default', [])) { }
170 4 0 if $path
176 0 25 unless my $hex = shift()
184 0 0 unless my $b64 = shift()
186 0 0 if ref $b64 eq 'ARRAY'
193 0 0 if $filename =~ /^[0-9a-f]{32}$/i
194 0 0 unless defined $filename
195 0 0 unless $md5
209 0 12 if (@_ == 1)
213 4 8 if $filename =~ /^[0-9a-f]{32}$/i
215 0 0 unless ($md5 or $abs_url)
220 12 0 unless $abs_url
226 8 13 if ($tries > @hosts + 1)
232 0 21 if ($abs_url) { }
235 9 12 if $host > $#hosts
244 11 10 unless (my $res = $tx->success)
247 1 10 if ($error->{'code'})
258 0 10 if ($host == 0)
263 0 0 if ($prev and $prev->code == 301)
268 5 4 ref $dest eq 'SCALAR' ? :
9 1 $dest ? :
273 0 10 if (my $e = $res->headers->header('Content-Encoding')) { }
274 0 0 unless $e eq 'gzip'
282 0 0 $asset->is_file ? :
0 0 unless (gunzip($asset->is_file ? $asset->path : \$asset->slurp, $out_file))
292 0 10 unless ($md5)
296 10 0 if ($verify eq $md5) { }
298 5 5 if (ref $dest eq 'SCALAR')
310 0 0 unless unlink $out_file
318 2 10 unless $success
319 2 10 unless $success
327 0 4 unless $filename and $md5
341 0 36 unless my $md5 = shift()
343 0 27 unless ($bucket_map and ref $bucket_map eq 'HASH' and keys %$bucket_map > 0)
344 0 9 unless $bucket_map = $self->bucket_map
345 9 0 if $bucket_map and ref $bucket_map and keys %$bucket_map > 0
347 0 36 unless ($bucket_map and ref $bucket_map and keys %$bucket_map > 0)
353 35 37 if exists $$bucket_map{lc $prefix}
354 1 36 if exists $$bucket_map{uc $prefix}
371 2 0 $tx->success ? :
389 16 4 ref $_[-1] eq 'SCALAR' ? :
406 0 20 if (defined $_[0] and $_[0] eq '--nostash')
413 2 18 defined $_[0] && $_[0] =~ /^[0-9a-f]+$/i ? :
415 0 20 if (@_)
419 0 20 unless $filename
420 16 4 if (defined $content) { }
431 0 20 unless -r $filename
449 0 23 $nostash ? :
464 4 19 unless ($tx->success)
466 4 0 if ref $error
471 1 19 unless $code and $tx->res->is_success
490 0 2 unless $status eq 'ok'
497 1 1 if (my $location = $args{'location'})
499 0 1 unless (my $res = $tx->success)
506 0 1 unless my $md5 = $args{'md5'}
507 0 1 unless my $name = $args{'name'}
513 0 1 unless my $res = $self->res
514 0 1 if (my $b64 = $res->headers->header('Content-MD5'))
517 1 0 if (my $location = $res->headers->location)
531 0 0 if (/^-c$/)
532 0 0 if (/^--show_corrupt$/)
535 0 0 unless $manifest
536 0 0 unless -e $manifest
539 0 0 unless $self->tx->success
540 0 0 @{$got->{'missing'};} == 0 ? :
541 0 0 if $check