Branch Coverage

blib/lib/Search/Elasticsearch/Role/Cxn.pm
Criterion Covered Total %
branch 51 94 54.2


line true false branch
103 170 5 unless (ref $node eq "HASH")
104 2 168 if Net::IP::ip_is_ipv6($node)
105 124 46 unless ($node =~ m[^http(s)?://])
106 1 123 $params->{'use_https'} ? :
108 3 167 if ($params->{'port'} and not $node =~ m(//[^/\[]+:\d+))
133 175 0 unless $params->{'default_headers'}
135 3 172 if ($userinfo)
142 0 175 if ($params->{'gzip'}) { }
1 174 elsif ($params->{'deflate'}) { }
156 0 0 if (defined $ENV{'ELASTIC_CLIENT_APIVERSIONING'} and lc $ENV{'ELASTIC_CLIENT_APIVERSIONING'} eq 'true' || $ENV{'ELASTIC_CLIENT_APIVERSIONING'} eq '1')
162 0 175 if (defined $params->{'elastic_cloud_api_key'} and defined $params->{'token_api'})
168 0 175 if (defined $params->{'elastic_cloud_api_key'})
173 0 175 if (defined $params->{'token_api'})
184 6 169 if Net::IP::ip_is_ipv6($host)
188 0 175 if (defined $params->{'client'})
291 3 2 unless $params->{'qs'}
319 0 0 if ($self->gzip) { }
0 0 elsif ($self->deflate) { }
320 0 0 unless IO::Compress::Gzip::gzip(\$params->{'data'}, \$output)
327 0 0 unless IO::Compress::Deflate::deflate(\$params->{'data'}, \$output)
339 0 239 if (my $encoding = $headers->{'content-encoding'})
341 0 0 if ($encoding eq 'gzip') { }
0 0 elsif ($encoding eq 'deflate') { }
342 0 0 unless IO::Uncompress::Gunzip::gunzip($body_ref, \$output)
349 0 0 unless IO::Uncompress::Inflate::inflate($body_ref, \$output, "Transparent", 0)
369 178 62 if ($self->client_version >= 8 and $code >= 200 and $code < 300)
371 1 177 if ($product ne $PRODUCT_CHECK_VALUE)
383 0 239 if (my $warnings = $headers->{'warning'})
391 177 62 if ($code >= 200 and $code <= 209)
392 141 36 if (defined $body and length $body)
393 140 1 if $is_encoded
397 34 2 if $params->{'method'} eq "HEAD"
403 11 51 if $params->{'method'} eq "HEAD"
404 2 60 if grep {$_ eq $code;} @ignore
408 49 11 unless ($error_type)
409 0 49 if (defined $body and length $body)
416 0 60 if $params->{'body'}
421 2 58 if ($body = $self->serializer->decode($body))
425 0 2 if $error_type eq "Conflict" and $msg =~ /: version conflict, current (?:version )?\[(\d+)\]/
439 0 0 ref $_[0] eq 'ARRAY' ? :
442 0 0 if ($_ =~ /^\d+\s+\S+\s+"((?:\\"|[^"])+)"/) { }
457 0 2 unless ref $body eq "HASH"
459 2 0 unless ref $error eq "HASH"
462 0 0 unless (@$root_causes)
463 0 0 if $error->{'type'}
464 0 0 if $error->{'reason'}
474 0 0 if (keys %cause)