Branch Coverage

blib/lib/Search/Elasticsearch/Role/Cxn.pm
Criterion Covered Total %
branch 43 82 52.4


line true false branch
99 170 5 unless (ref $node eq "HASH")
100 2 168 if Net::IP::ip_is_ipv6($node)
101 124 46 unless ($node =~ m[^http(s)?://])
102 1 123 $params->{'use_https'} ? :
104 3 167 if ($params->{'port'} and not $node =~ m(//[^/\[]+:\d+))
129 175 0 unless $params->{'default_headers'}
131 3 172 if ($userinfo)
138 0 175 if ($params->{'gzip'}) { }
1 174 elsif ($params->{'deflate'}) { }
152 0 0 if (defined $ENV{'ELASTIC_CLIENT_APIVERSIONING'} and lc $ENV{'ELASTIC_CLIENT_APIVERSIONING'} eq 'true' || $ENV{'ELASTIC_CLIENT_APIVERSIONING'} eq '1')
164 6 169 if Net::IP::ip_is_ipv6($host)
267 3 2 unless $params->{'qs'}
295 0 0 if ($self->gzip) { }
0 0 elsif ($self->deflate) { }
296 0 0 unless IO::Compress::Gzip::gzip(\$params->{'data'}, \$output)
303 0 0 unless IO::Compress::Deflate::deflate(\$params->{'data'}, \$output)
315 0 238 if (my $encoding = $headers->{'content-encoding'})
317 0 0 if ($encoding eq 'gzip') { }
0 0 elsif ($encoding eq 'deflate') { }
318 0 0 unless IO::Uncompress::Gunzip::gunzip($body_ref, \$output)
325 0 0 unless IO::Uncompress::Inflate::inflate($body_ref, \$output, "Transparent", 0)
350 0 238 if (my $warnings = $headers->{'warning'})
359 176 62 if ($code >= 200 and $code <= 209)
360 141 35 if (defined $body and length $body)
361 140 1 if $is_encoded
365 34 1 if $params->{'method'} eq "HEAD"
371 11 51 if $params->{'method'} eq "HEAD"
372 2 60 if grep {$_ eq $code;} @ignore
376 49 11 unless ($error_type)
377 0 49 if (defined $body and length $body)
384 0 60 if $params->{'body'}
389 2 58 if ($body = $self->serializer->decode($body))
393 0 2 if $error_type eq "Conflict" and $msg =~ /: version conflict, current (?:version )?\[(\d+)\]/
407 0 0 ref $_[0] eq 'ARRAY' ? :
410 0 0 if ($_ =~ /^\d+\s+\S+\s+"((?:\\"|[^"])+)"/) { }
425 0 2 unless ref $body eq "HASH"
427 2 0 unless ref $error eq "HASH"
430 0 0 unless (@$root_causes)
431 0 0 if $error->{'type'}
432 0 0 if $error->{'reason'}
442 0 0 if (keys %cause)