Condition Coverage

blib/lib/Net/BitTorrent/Protocol.pm
Criterion Covered Total %
condition 10 14 71.4


and 3 conditions

line !l l&&!r l&&r condition
76 0 0 38 defined unpack('N', $$data) and unpack('N', $$data) =~ /\d/
96 35 0 0 ref $payload eq 'HASH' && defined $payload->{'error'}

or 2 conditions

line l !l condition
52 43 1 $parse_packet_dispatch ||= {$Net::BitTorrent::Protocol::KEEPALIVE, \&Net::BitTorrent::Protocol::parse_keepalive, $Net::BitTorrent::Protocol::CHOKE, \&Net::BitTorrent::Protocol::parse_choke, $Net::BitTorrent::Protocol::UNCHOKE, \&Net::BitTorrent::Protocol::parse_unchoke, $Net::BitTorrent::Protocol::INTERESTED, \&Net::BitTorrent::Protocol::parse_interested, $Net::BitTorrent::Protocol::NOT_INTERESTED, \&Net::BitTorrent::Protocol::parse_not_interested, $Net::BitTorrent::Protocol::HAVE, \&Net::BitTorrent::Protocol::parse_have, $Net::BitTorrent::Protocol::BITFIELD, \&Net::BitTorrent::Protocol::parse_bitfield, $Net::BitTorrent::Protocol::REQUEST, \&Net::BitTorrent::Protocol::parse_request, $Net::BitTorrent::Protocol::PIECE, \&Net::BitTorrent::Protocol::parse_piece, $Net::BitTorrent::Protocol::CANCEL, \&Net::BitTorrent::Protocol::parse_cancel, $Net::BitTorrent::Protocol::PORT, \&Net::BitTorrent::Protocol::parse_port, $Net::BitTorrent::Protocol::SUGGEST, \&Net::BitTorrent::Protocol::parse_suggest, $Net::BitTorrent::Protocol::HAVE_ALL, \&Net::BitTorrent::Protocol::parse_have_all, $Net::BitTorrent::Protocol::HAVE_NONE, \&Net::BitTorrent::Protocol::parse_have_none, $Net::BitTorrent::Protocol::REJECT, \&Net::BitTorrent::Protocol::parse_reject, $Net::BitTorrent::Protocol::ALLOWED_FAST, \&Net::BitTorrent::Protocol::parse_allowed_fast, $Net::BitTorrent::Protocol::EXTENDED, \&Net::BitTorrent::Protocol::parse_extended}

or 3 conditions

line l !l&&r !l&&!r condition
71 1 2 41 not $data or ref $data ne 'SCALAR'
3 2 39 not $data or ref $data ne 'SCALAR' or not $$data