Branch Coverage

lib/Amazon/S3.pm
Criterion Covered Total %
branch 21 246 8.5


line true false branch
74 3 0 ref $args[0] ? :
92 3 0 unless ($options{'logger'})
93 0 3 if (delete $options{'debug'})
112 0 0 if ($safe_options{'aws_secret_access_key'})
121 3 0 unless ($self->credentials)
123 0 3 unless $self->aws_access_key_id
126 0 3 unless $self->aws_secret_access_key
137 0 3 if ($self->retry) { }
158 0 3 if (not $self->_signer and $self->cache_signer)
162 0 3 if ($self->express)
195 3 6 unless $text
197 6 0 unless (defined $encryption_key)
199 6 0 if (not defined $encryption_key)
207 6 0 if $Amazon::S3::EVAL_ERROR
210 0 0 unless $encryption_key
227 0 0 unless $secret and $encryption_key
248 0 0 if (not ref $bucket or ref !($bucket =~ /Amazon::S3::Bucket/msx))
262 0 0 if $region
274 0 0 if ($response and $response->is_success)
275 0 0 if ($response->content =~ /\A([[:lower:]]+[-][[:lower:]]+[-]\d+)/msx)
314 3 0 unless $self->retry
333 0 0 unless $self->retry
351 4 3 if (@args)
358 7 0 if ($self->_region)
362 7 0 if ($host =~ /\As3[.](.*)?amazonaws/msx)
393 0 0 if not $r or $self->errstr
401 0 0 if (ref $r->{'Buckets'})
404 0 0 if (not ref $buckets or builtin::reftype($buckets) ne "ARRAY")
441 0 0 if ($self->cache_signer) { }
442 0 0 if ($self->region and $self->region ne $Amazon::S3::DEFAULT_REGION)
443 0 0 if ($self->signer->can("region"))
462 0 0 unless $bucket
467 0 0 if ($conf->{'acl_short'})
478 0 0 if ($region and $region eq $Amazon::S3::DEFAULT_REGION)
507 0 0 if ($availability_zone)
523 0 0 $region || $availability_zone ? :
539 0 0 $retval ? :
551 0 0 if (ref $args[0] and builtin::reftype($args[0]) eq 'HASH') { }
561 0 0 unless ($region or $verify_region)
583 0 0 if (eval { do { return $conf->isa('Amazon::S3::Bucket') } }) { }
593 0 0 unless $bucket
645 0 0 unless $bucket
660 0 0 if ($conf->{'marker'})
664 0 0 if (%{$conf;})
670 0 0 if defined $conf->{$_}
700 0 0 if not $r or $self->errstr
721 0 0 defined $r->{'IsTruncated'} && scalar $r->{'IsTruncated'} eq 'true' ? :
732 0 0 if (defined $etag)
750 0 0 if ($conf->{'delimiter'})
755 0 0 if (ref $node ne "ARRAY")
760 0 0 unless exists $n->{'Prefix'}
764 0 0 if ($prefix)
798 0 0 unless $bucket
803 0 0 unless $response
807 0 0 unless $response->{'is_truncated'}
820 0 0 unless $response
825 0 0 unless $response->{'is_truncated'}
864 0 0 unless $bucket
869 0 0 unless $bucket
877 0 0 if ($conf->{'key-marker'})
881 0 0 if (%{$conf;})
885 0 0 if defined $conf->{$_}
903 0 0 if not $r or $self->errstr
928 0 0 if ($self->credentials) { }
956 6 11 if (@args)
970 0 0 if $self->_signer
973 0 0 $self->credentials ? :
976 0 0 $express ? :
985 0 0 if ($self->cache_signer)
999 0 0 if &none(sub { $policy_name eq $_; } , "private", "public-read", "public-read-write", "authenticated-read")
1023 0 0 if length $bucketname > $Amazon::S3::MAX_BUCKET_NAME_LENGTH - 1
1026 0 0 if length $bucketname < $Amazon::S3::MIN_BUCKET_NAME_LENGTH
1029 0 0 unless $bucketname =~ /\A[[:lower:]][[:lower:]\d-]*\z/msx
1032 0 0 unless $bucketname =~ /[[:lower:]\d]\z/msx
1051 0 0 unless $method
1054 0 0 unless defined $path
1066 0 0 $self->secure ? :
1074 0 0 if ($path =~ m[\A([^/?]+)([^?]+)(.*)]msx and $self->dns_bucket_names and is_domain_bucket($1))
1094 0 0 if ($host =~ /([^:]+):([^:]\d+)$/msx) { }
1112 0 0 if not $url or $Amazon::S3::EVAL_ERROR
1128 0 0 if ($data)
1158 0 0 if ref($args[0]) =~ /HTTP::Request/msx
1161 0 0 if @args > 1 and !@args % 2
1164 0 0 if ref $args[0]
1170 0 0 unless (ref($request) =~ /HTTP::Request/msx)
1196 0 0 if (not $response->code =~ /\A2\d{2}\z/msx) { }
0 0 elsif (is_xml_response($response)) { }
1212 0 0 unless $rsp->content
1215 0 0 if $rsp->content_type eq "application/xml"
1218 0 0 if $rsp->content =~ /\A\s*<[?]xml/msx
1258 0 0 if $response->is_success
1263 0 0 unless is_xml_response($response)
1272 0 0 if $code eq "PermanentRedirect" and $endpoint
1275 0 0 if $code eq "AuthorizationHeaderMalformed" and $region
1278 0 0 if $code eq "IllegalLocationConstraintException"
1287 0 0 if $called_from_redirect
1309 0 0 unless ($called_from_redirect)
1317 0 0 if ($message =~ /The (\S+) location/msx)
1366 0 0 if ($response->code =~ /\A3/msx and defined $location)
1416 0 0 if $response->code =~ /^2\d\d$/msx
1458 0 0 if ($response->code =~ /^3/msx)
1459 0 0 if (defined $response->header('Location')) { }
1482 0 0 if (defined $override_uri)
1492 0 0 if $response->code =~ /^2\d\d$/msx
1506 0 0 unless ($response->code =~ /^2\d{2}$/msx)
1532 0 0 if (not $xml_hr and $Amazon::S3::EVAL_ERROR)
1546 0 0 unless $src
1548 0 0 unless (ref $src or $src =~ /^[[:space:]]*
1557 0 0 ref $src ? :
1562 0 0 if ($r->{'Error'})
1568 0 0 unless $code
1586 0 0 unless ($headers->header("Date"))
1590 0 0 if ($token)
1658 0 0 if ($lk eq "content-md5" or $lk eq "content-type" or $lk eq "date" or $lk =~ /^$Amazon::S3::AMAZON_HEADER_PREFIX/msx)
1671 0 0 if ($interesting_headers{'x-amz-date'})
1677 0 0 if ($expires)
1684 0 0 if ($key =~ /^$Amazon::S3::AMAZON_HEADER_PREFIX/msx) { }
1699 0 0 if ($path =~ /[&?](acl|torrent|location|uploads|delete)([=&]|$)/msx) { }
0 0 elsif (my(%query_params) = 'URI'->new($path)->query_form) { }
1707 0 0 if ($query_params{'partNumber'} and $query_params{'uploadId'}) { }
0 0 elsif ($query_params{'uploadId'}) { }
1746 0 0 $urlencode ? :
1761 0 0 unless ($region or $verify_region)