Branch Coverage

lib/Amazon/S3.pm
Criterion Covered Total %
branch 20 218 9.1


line true false branch
61 3 0 ref $args[0] ? :
78 3 0 unless ($options{'logger'})
79 0 3 if (delete $options{'debug'})
98 0 0 if ($safe_options{'aws_secret_access_key'})
107 3 0 unless ($self->credentials)
109 0 3 unless $self->aws_access_key_id
112 0 3 unless $self->aws_secret_access_key
123 0 3 if ($self->retry) { }
144 0 3 if (not $self->_signer and $self->cache_signer)
162 3 6 unless $text
164 6 0 unless (defined $encryption_key)
166 6 0 if (not defined $encryption_key)
175 6 0 if (not $encryption_key or $Amazon::S3::EVAL_ERROR)
194 0 0 unless $secret and $encryption_key
215 0 0 if (not ref $bucket or ref !($bucket =~ /Amazon::S3::Bucket/msx))
229 0 0 if $region
242 0 0 if ($response and $response->is_success)
243 0 0 if ($response->content =~ /\A([[:lower:]]+[-][[:lower:]]+[-]\d+)/msx)
281 0 3 if ($self->retry)
300 0 0 if ($self->retry)
319 4 3 if (@args)
326 7 0 if ($self->_region)
330 7 0 if ($host =~ /\As3[.](.*)?amazonaws/msx)
361 0 0 if not $r or $self->errstr
369 0 0 if (ref $r->{'Buckets'})
372 0 0 if (not ref $buckets or &reftype($buckets) ne "ARRAY")
409 0 0 if ($self->cache_signer) { }
410 0 0 if ($self->region and $self->region ne $Amazon::S3::DEFAULT_REGION)
411 0 0 if ($self->signer->can("region"))
431 0 0 if ($region and $region eq $Amazon::S3::DEFAULT_REGION)
437 0 0 unless $bucket
442 0 0 if ($conf->{'acl_short'})
454 0 0 defined $region ? :
465 0 0 $retval ? :
477 0 0 if (ref $args[0] and &reftype($args[0]) eq 'HASH') { }
487 0 0 unless ($region or $verify_region)
508 0 0 if (eval { do { return $conf->isa('Amazon::S3::Bucket') } }) { }
517 0 0 unless $bucket
546 0 0 unless $bucket
558 0 0 if ($conf->{'marker'})
562 0 0 if (%{$conf;})
568 0 0 if defined $conf->{$_}
599 0 0 if not $r or $self->errstr
620 0 0 defined $r->{'IsTruncated'} && scalar $r->{'IsTruncated'} eq 'true' ? :
631 0 0 if (defined $etag)
649 0 0 if ($conf->{'delimiter'})
654 0 0 if (ref $node ne "ARRAY")
659 0 0 unless exists $n->{'Prefix'}
663 0 0 if ($prefix)
698 0 0 unless $bucket
703 0 0 unless $response
707 0 0 unless $response->{'is_truncated'}
720 0 0 unless $response
725 0 0 unless $response->{'is_truncated'}
743 0 0 if ($self->credentials) { }
771 6 11 if (@args)
785 0 0 if $self->_signer
788 0 0 $self->credentials ? :
790 0 0 $self->get_token ? :
799 0 0 if ($self->cache_signer)
811 0 0 unless (&any(sub { $policy_name eq $_; } , "private", "public-read", "public-read-write", "authenticated-read"))
829 0 0 if (length $bucketname > $Amazon::S3::MAX_BUCKET_NAME_LENGTH - 1)
833 0 0 if (length $bucketname < $Amazon::S3::MIN_BUCKET_NAME_LENGTH)
837 0 0 unless $bucketname =~ /\A[[:lower:]][[:lower:]\d-]*\z/msx
838 0 0 unless $bucketname =~ /[[:lower:]\d]\z/msx
851 0 0 if (ref $args[0] and &reftype($args[0]) eq 'HASH') { }
862 0 0 unless $method
865 0 0 unless defined $path
876 0 0 $self->secure ? :
883 0 0 if ($path =~ m[\A([^/?]+)([^?]+)(.*)]msx and $self->dns_bucket_names and _can_bucket_be_subdomain($1))
891 0 0 if ($host =~ /([^:]+):([^:]\d+)$/msx) { }
907 0 0 if not $url or $Amazon::S3::EVAL_ERROR
948 0 0 if (@args == 1 and ref($args[0]) =~ /HTTP::Request/msx) { }
952 0 0 if (ref $args[0])
967 0 0 if (not $response->code =~ /\A2\d\d\z/msx) { }
0 0 elsif ($content and $response->content_type eq 'application/xml') { }
1009 0 0 if $response->is_success
1014 0 0 if ($response->content_type eq "application/xml" and $response->content)
1018 0 0 if ($error_hash->{'Code'} eq "PermanentRedirect" and $error_hash->{'Endpoint'})
1022 0 0 if $called_from_redirect
1039 0 0 if ($error_hash->{'Code'} eq "AuthorizationHeaderMalformed" and $error_hash->{'Region'})
1047 0 0 unless ($called_from_redirect)
1054 0 0 if ($error_hash->{'Code'} eq "IllegalLocationConstraintException")
1057 0 0 if ($error_hash->{'Message'} =~ /The (\S+) location/msx)
1102 0 0 if ($response->code =~ /\A3/msx and defined $response->header("Location"))
1151 0 0 if $response->code =~ /^2\d\d$/msx
1174 0 0 if (@args == 1 and ref $args[0]) { }
1199 0 0 if ($response->code =~ /^3/msx)
1200 0 0 if (defined $response->header('Location')) { }
1219 0 0 if (defined $override_uri)
1229 0 0 if $response->code =~ /^2\d\d$/msx
1243 0 0 unless ($response->code =~ /^2\d\d$/msx)
1270 0 0 if (not $xml_hr and $Amazon::S3::EVAL_ERROR)
1283 0 0 unless $src
1286 0 0 unless (ref $src or $src =~ /^[[:space:]]*
1295 0 0 ref $src ? :
1300 0 0 if ($r->{'Error'})
1304 0 0 if ($r->{'Code'})
1325 0 0 unless ($headers->header("Date"))
1329 0 0 if ($token)
1387 0 0 if ($lk eq "content-md5" or $lk eq "content-type" or $lk eq "date" or $lk =~ /^$Amazon::S3::AMAZON_HEADER_PREFIX/msx)
1400 0 0 if ($interesting_headers{'x-amz-date'})
1406 0 0 if ($expires)
1413 0 0 if ($key =~ /^$Amazon::S3::AMAZON_HEADER_PREFIX/msx) { }
1428 0 0 if ($path =~ /[&?](acl|torrent|location|uploads|delete)([=&]|$)/msx) { }
0 0 elsif (my(%query_params) = 'URI'->new($path)->query_form) { }
1436 0 0 if ($query_params{'partNumber'} and $query_params{'uploadId'}) { }
0 0 elsif ($query_params{'uploadId'}) { }
1475 0 0 $urlencode ? :