Condition Coverage

lib/Kafka/Connection.pm
Criterion Covered Total %
condition 74 155 47.7


and 3 conditions

line !l l&&!r l&&r condition
445 1336 994 0 exists $p{$_} and $self->{$_} = $p{$_}
448 1 7 225 defined $self->{'host'} and $self->{'host'} eq '' || defined &_STRING($self->{'host'})
7 1 224 defined $self->{'host'} and $self->{'host'} eq '' || defined &_STRING($self->{'host'}) and not utf8::is_utf8($self->{'host'})
452 10 0 199 defined &_NUMBER($self->{'timeout'}) and int 1000 * $self->{'timeout'} >= 1
10 0 199 defined &_NUMBER($self->{'timeout'}) and int 1000 * $self->{'timeout'} >= 1 and int $self->{'timeout'} * 1000 <= $Kafka::Connection::MAX_INT32
463 1 3 0 defined &_NONNEGINT($ip_version) and $ip_version == $Kafka::Connection::IP_V4 || $ip_version == $Kafka::Connection::IP_V6
573 0 0 0 &blessed($error) and $error->isa('Kafka::Exception')
645 0 0 0 defined $decoded_response->{'CorrelationId'} and $decoded_response->{'CorrelationId'} == $CorrelationId
690 0 0 1 $topic eq '' || defined &_STRING($topic) and not utf8::is_utf8($topic)
755 0 8 6 exists $io_cache->{$server} and $io = $io_cache->{$server}{'IO'}
825 0 0 10046 not $self->{'AutoCreateTopicsEnable'} and defined $topic_name
0 10046 0 not $self->{'AutoCreateTopicsEnable'} and defined $topic_name and not exists $self->{'_metadata'}{$topic_name}
868 0 0 0 not %{$self->{'_group_coordinators'};} and defined $group_id
916 2 4 0 $api_key == $Kafka::Connection::APIKEY_PRODUCE and not $ErrorCode == $Kafka::Connection::ERROR_CANNOT_BIND || $ErrorCode == $Kafka::Connection::ERROR_NO_CONNECTION
925 5034 97 5009 $api_key == $Kafka::Connection::APIKEY_PRODUCE and $request->{'RequiredAcks'} == $Kafka::Connection::NOT_SEND_ANY_RESPONSE
984 0 84 0 $api_key == $Kafka::Connection::APIKEY_PRODUCE and $ErrorCode == $Kafka::Connection::ERROR_REQUEST_TIMED_OUT
1050 0 0 3 defined $topic and $topic eq '' || defined &_STRING($topic)
0 0 3 defined $topic and $topic eq '' || defined &_STRING($topic) and not utf8::is_utf8($topic)
1052 0 0 3 defined $partition and &isint($partition)
0 0 3 defined $partition and &isint($partition) and $partition >= 0
1157 50 322 0 $host and $host =~ /^\[(.+)\]$/
1175 0 0 0 defined $error_code && exists $Kafka::Connection::ERROR{$error_code}
1199 0 109 118 defined $NodeId and $NodeId == $node_id
1253 0 0 0 $self->_connectIO($broker) and $self->_sendIO($broker, $encoded_request)
0 0 0 $self->_connectIO($broker) and $self->_sendIO($broker, $encoded_request) and $encoded_response_ref = $self->_receiveIO($broker)
1268 0 0 0 defined $decoded_response->{'CorrelationId'} and $decoded_response->{'CorrelationId'} == $CorrelationId
1310 0 9 121 $self->_connectIO($broker) and $self->_sendIO($broker, $encoded_request)
8 3 118 $self->_connectIO($broker) and $self->_sendIO($broker, $encoded_request) and $encoded_response_ref = $self->_receiveIO($broker)
1325 0 0 118 defined $decoded_response->{'CorrelationId'} and $decoded_response->{'CorrelationId'} == $CorrelationId
1372 118 0 0 ($ErrorCode = $partition_metadata->{'ErrorCode'}) != $Kafka::Connection::ERROR_NO_ERROR and $ErrorCode != $Kafka::Connection::ERROR_REPLICA_NOT_AVAILABLE
1442 0 0 20 &blessed($error) and $error->isa('Kafka::Exception')
1538 0 0 5247 $response_ref and length $$response_ref == 4
1573 5 35 227 defined $server and defined &_STRING($server)
40 5 222 defined $server and defined &_STRING($server) and not utf8::is_utf8($server)
1582 50 0 172 is_hostname($host) || is_ipv4($host) || is_ipv6($host) and $port

or 2 conditions

line l !l condition
593 0 0 $Kafka::Connection::IMPLEMENTED_APIVERSIONS->{$api_key} // -1
816 0 10098 $request->{'__send_to__'} // 'leader'
850 10163 0 $self->{'SEND_MAX_ATTEMPTS'} // 1
1175 71 0 $error_code // 'IO error'

or 3 conditions

line l !l&&r !l&&!r condition
448 1 224 7 $self->{'host'} eq '' || defined &_STRING($self->{'host'})
452 0 209 0 not defined $self->{'timeout'} or defined &_NUMBER($self->{'timeout'}) and int 1000 * $self->{'timeout'} >= 1 and int $self->{'timeout'} * 1000 <= $Kafka::Connection::MAX_INT32
463 2 0 1 $ip_version == $Kafka::Connection::IP_V4 || $ip_version == $Kafka::Connection::IP_V6
149 0 4 not defined $ip_version or defined &_NONNEGINT($ip_version) and $ip_version == $Kafka::Connection::IP_V4 || $ip_version == $Kafka::Connection::IP_V6
690 0 1 0 $topic eq '' || defined &_STRING($topic)
0 1 0 not defined $topic or $topic eq '' || defined &_STRING($topic) and not utf8::is_utf8($topic)
825 52 0 10046 not %{$self->{'_metadata'};} or not $self->{'AutoCreateTopicsEnable'} and defined $topic_name and not exists $self->{'_metadata'}{$topic_name}
916 4 0 0 $ErrorCode == $Kafka::Connection::ERROR_CANNOT_BIND || $ErrorCode == $Kafka::Connection::ERROR_NO_CONNECTION
1010 3 0 0 $ErrorCode || $Kafka::Connection::ERROR_CANNOT_GET_METADATA
1050 0 3 0 $topic eq '' || defined &_STRING($topic)
1175 71 0 0 $error // (defined $error_code && exists $Kafka::Connection::ERROR{$error_code} ? $Kafka::Connection::ERROR{$error_code} : '')
1292 124 0 0 $topic // ()
1443 1 0 19 $error->code == $Kafka::Connection::ERROR_MISMATCH_ARGUMENT or $error->code == $Kafka::Connection::ERROR_INCOMPATIBLE_HOST_IP_VERSION
1582 172 0 50 is_hostname($host) || is_ipv4($host) || is_ipv6($host)