Branch Coverage

lib/Kafka/Producer.pm
Criterion Covered Total %
branch 38 64 59.3


line true false branch
217 249 0 if (exists $self->{$p}) { }
228 20 87 unless &_INSTANCE($self->{'Connection'}, 'Kafka::Connection')
230 7 80 unless $self->{'ClientId'} eq '' or defined &_STRING($self->{'ClientId'})
232 1 79 if utf8::is_utf8($self->{'ClientId'})
237 0 70 unless defined &_NUMBER($self->{'Timeout'}) and int $self->{'Timeout'} * 1000 >= 1 and int $self->{'Timeout'} * 1000 <= $Kafka::Producer::MAX_INT32
240 10 58 unless defined $required_acks and &isint($required_acks) and $required_acks == $Kafka::Producer::NOT_SEND_ANY_RESPONSE || $required_acks == $Kafka::Producer::WAIT_WRITTEN_TO_LOCAL_LOG || $required_acks == $Kafka::Producer::BLOCK_UNTIL_IS_COMMITTED
331 7 5063 unless defined $topic and $topic eq '' || defined &_STRING($topic)
333 1 5062 if utf8::is_utf8($topic)
335 10 5052 unless defined $partition and &isint($partition) and $partition >= 0
337 5 5047 unless defined &_STRING($messages) or &_ARRAY($messages)
339 6 22 unless not defined $keys or defined &_STRING($keys) or &_ARRAY($keys)
342 12 3 unless not defined $compression_codec or $known_compression_codecs{$compression_codec}
343 0 0 unless not defined $timestamps or defined &_POSINT($timestamps) or &_ARRAY($timestamps)
346 8 5021 unless ref $messages
348 7 10035 unless defined $message and $message eq '' || defined &_STRING($message)
350 2 10033 if utf8::is_utf8($message)
356 0 5020 if (&_ARRAY($keys)) { }
1 5019 elsif (defined $keys) { }
358 0 0 unless scalar @$keys == scalar @$messages
362 0 0 unless not defined $key or $key eq '' or defined &_STRING($key)
364 0 0 if utf8::is_utf8($key)
369 0 1 unless $keys eq '' or defined &_STRING($keys)
371 1 0 if utf8::is_utf8($keys)
381 0 5019 if (&_ARRAY($timestamps)) { }
0 5019 elsif (defined $timestamps) { }
383 0 0 unless scalar @$timestamps == scalar @$messages
387 0 0 unless not defined $ts or defined &_POSINT($ts)
393 0 0 unless defined &_POSINT($timestamps)
418 0 5019 if (defined $compression_codec and $compression_codec == $Kafka::Producer::COMPRESSION_LZ4 or defined $timestamps)
424 10032 0 defined $common_key ? :
0 0 defined $common_ts ? :
0 10032 $use_ts ? :