Branch Coverage

blib/lib/OpenSearch/Client/Role/Cxn.pm
Criterion Covered Total %
branch 43 80 53.7


line true false branch
97 170 5 unless (ref $node eq "HASH")
98 2 168 if Net::IP::ip_is_ipv6($node)
99 124 46 unless ($node =~ m[^http(s)?://])
100 1 123 $params->{'use_https'} ? :
102 3 167 if ($params->{'port'} and not $node =~ m(//[^/\[]+:\d+))
127 175 0 unless $params->{'default_headers'}
129 3 172 if ($userinfo)
136 0 175 if ($params->{'gzip'}) { }
1 174 elsif ($params->{'deflate'}) { }
152 6 169 if Net::IP::ip_is_ipv6($host)
255 3 2 unless $params->{'qs'}
283 0 0 if ($self->gzip) { }
0 0 elsif ($self->deflate) { }
284 0 0 unless IO::Compress::Gzip::gzip(\$params->{'data'}, \$output)
291 0 0 unless IO::Compress::Deflate::deflate(\$params->{'data'}, \$output)
303 0 238 if (my $encoding = $headers->{'content-encoding'})
305 0 0 if ($encoding eq 'gzip') { }
0 0 elsif ($encoding eq 'deflate') { }
306 0 0 unless IO::Uncompress::Gunzip::gunzip($body_ref, \$output)
313 0 0 unless IO::Uncompress::Inflate::inflate($body_ref, \$output, "Transparent", 0)
338 0 238 if (my $warnings = $headers->{'warning'})
347 176 62 if ($code >= 200 and $code <= 209)
348 141 35 if (defined $body and length $body)
349 140 1 if $is_encoded
353 34 1 if $params->{'method'} eq "HEAD"
359 11 51 if $params->{'method'} eq "HEAD"
360 2 60 if grep {$_ eq $code;} @ignore
364 49 11 unless ($error_type)
365 0 49 if (defined $body and length $body)
372 0 60 if $params->{'body'}
377 2 58 if ($body = $self->serializer->decode($body))
381 0 2 if $error_type eq "Conflict" and $msg =~ /: version conflict, current (?:version )?\[(\d+)\]/
395 0 0 ref $_[0] eq 'ARRAY' ? :
398 0 0 if ($_ =~ /^\d+\s+\S+\s+"((?:\\"|[^"])+)"/) { }
413 0 2 unless ref $body eq "HASH"
415 2 0 unless ref $error eq "HASH"
418 0 0 unless (@$root_causes)
419 0 0 if $error->{'type'}
420 0 0 if $error->{'reason'}
430 0 0 if (keys %cause)