Branch Coverage

blib/lib/Search/Elasticsearch/Role/Cxn.pm
Criterion Covered Total %
branch 50 92 54.3


line true false branch
102 170 5 unless (ref $node eq "HASH")
103 2 168 if Net::IP::ip_is_ipv6($node)
104 124 46 unless ($node =~ m[^http(s)?://])
105 1 123 $params->{'use_https'} ? :
107 3 167 if ($params->{'port'} and not $node =~ m(//[^/\[]+:\d+))
132 175 0 unless $params->{'default_headers'}
134 3 172 if ($userinfo)
141 0 175 if ($params->{'gzip'}) { }
1 174 elsif ($params->{'deflate'}) { }
155 0 0 if (defined $ENV{'ELASTIC_CLIENT_APIVERSIONING'} and lc $ENV{'ELASTIC_CLIENT_APIVERSIONING'} eq 'true' || $ENV{'ELASTIC_CLIENT_APIVERSIONING'} eq '1')
161 0 175 if (defined $params->{'elastic_cloud_api_key'} and defined $params->{'token_api'})
167 0 175 if (defined $params->{'elastic_cloud_api_key'})
172 0 175 if (defined $params->{'token_api'})
183 6 169 if Net::IP::ip_is_ipv6($host)
286 3 2 unless $params->{'qs'}
314 0 0 if ($self->gzip) { }
0 0 elsif ($self->deflate) { }
315 0 0 unless IO::Compress::Gzip::gzip(\$params->{'data'}, \$output)
322 0 0 unless IO::Compress::Deflate::deflate(\$params->{'data'}, \$output)
334 0 239 if (my $encoding = $headers->{'content-encoding'})
336 0 0 if ($encoding eq 'gzip') { }
0 0 elsif ($encoding eq 'deflate') { }
337 0 0 unless IO::Uncompress::Gunzip::gunzip($body_ref, \$output)
344 0 0 unless IO::Uncompress::Inflate::inflate($body_ref, \$output, "Transparent", 0)
364 178 62 if ($code >= 200 and $code < 300)
366 1 177 if ($product ne $PRODUCT_CHECK_VALUE)
378 0 239 if (my $warnings = $headers->{'warning'})
386 177 62 if ($code >= 200 and $code <= 209)
387 141 36 if (defined $body and length $body)
388 140 1 if $is_encoded
392 34 2 if $params->{'method'} eq "HEAD"
398 11 51 if $params->{'method'} eq "HEAD"
399 2 60 if grep {$_ eq $code;} @ignore
403 49 11 unless ($error_type)
404 0 49 if (defined $body and length $body)
411 0 60 if $params->{'body'}
416 2 58 if ($body = $self->serializer->decode($body))
420 0 2 if $error_type eq "Conflict" and $msg =~ /: version conflict, current (?:version )?\[(\d+)\]/
434 0 0 ref $_[0] eq 'ARRAY' ? :
437 0 0 if ($_ =~ /^\d+\s+\S+\s+"((?:\\"|[^"])+)"/) { }
452 0 2 unless ref $body eq "HASH"
454 2 0 unless ref $error eq "HASH"
457 0 0 unless (@$root_causes)
458 0 0 if $error->{'type'}
459 0 0 if $error->{'reason'}
469 0 0 if (keys %cause)