Branch Coverage

blib/lib/Amazon/S3/Lite.pm
Criterion Covered Total %
branch 89 136 65.4


line true false branch
29 0 16 if ref $args ne "HASH"
33 1 15 unless $args->{'region'}
58 1 14 if ($logger)
61 0 5 unless $logger->can($method)
68 0 14 if (eval { do { require Log::Log4perl; 1 } })
69 0 0 unless ("Log::Log4perl"->initialized)
92 2 12 if (my $creds = $args->{'credentials'})
93 0 2 unless builtin::blessed($creds)
99 1 4 unless $sub
109 11 0 if ($args->{'aws_access_key_id'} and $args->{'aws_secret_access_key'})
119 1 0 if ($ENV{'AWS_ACCESS_KEY_ID'} and $ENV{'AWS_SECRET_ACCESS_KEY'})
130 0 0 if (eval { do { require Amazon::Credentials; 1 } })
189 26 0 $self->{'secure'} ? :
197 23 3 if defined $bucket and length $bucket
198 20 6 if defined $key and length $key
236 0 0 if length $content and not $content_is_coderef
243 0 0 $token_sub ? :
245 0 0 if (defined $token and length $token)
250 0 0 unless ($content_is_coderef)
251 0 0 ref $content eq 'SCALAR' ? :
258 0 0 $content_is_coderef ? :
278 0 0 if length $content or $content_is_coderef
281 0 0 if ($extra->{'data_callback'})
304 1 3 unless defined $bucket and length $bucket
305 1 2 unless defined $key and length $key
311 1 1 if _is_not_found($response)
327 4 0 if defined $etag
332 1 14 if ($name =~ /^x-amz-meta-(.+)$/msx)
361 0 4 unless defined $bucket and length $bucket
362 0 4 unless defined $key and length $key
367 1 3 if defined $options{'range'}
372 1 3 if (defined $filename)
375 0 1 unless open my $fh, ">", $filename
380 0 2 unless print {$fh;} $data
386 0 1 unless close $fh
390 0 1 if _is_not_found($response)
402 1 2 if _is_not_found($response)
426 1 5 unless defined $bucket and length $bucket
427 1 4 unless defined $key and length $key
431 2 2 if (defined $options{'version_id'})
519 4 18 unless defined $args{$required} and length $args{$required}
553 1 2 if ($root eq "Error")
563 2 0 if defined $etag
585 1 7 unless defined $bucket and length $bucket
586 1 6 unless defined $key and length $key
587 1 5 unless defined $data
595 1 4 if ($options{'acl'})
600 1 4 if (my $meta = $options{'metadata'})
602 0 1 $k =~ /^x-amz-meta-/msx ? :
609 2 3 if (&openhandle($data) or builtin::blessed($data) and $data->can('read')) { }
1 2 elsif (ref $data eq 'SCALAR') { }
613 2 0 unless (defined $content_length)
617 1 1 if @st and defined $st[7]
620 1 1 unless defined $content_length
630 0 0 if $n
652 4 0 if defined $etag
686 1 2 unless defined $bucket and length $bucket
701 1 9 if (defined $options{$opt})
715 1 1 if _is_not_found($response)
733 0 1 $xpc->findvalue("$root/s3:IsTruncated") eq 'true' ? :
735 0 1 $is_truncated ? :
744 2 0 if defined $etag
792 1 2 if defined $continuation_token
797 0 3 unless $result
801 2 1 unless $result->{'is_truncated'}
823 16 2 if _is_success($response)
830 0 2 if ($response->{'content'} and $response->{'content'} =~ /<\?xml/msx)
835 0 0 if $code or $msg