Branch Coverage

blib/lib/Net/BitTorrent/Torrent/Tracker/UDP.pm
Criterion Covered Total %
branch 28 64 43.7


line true false branch
24 1 25 unless ($args)
28 3 22 unless ($$args{'URL'} and $$args{'URL'} =~ m[^udp://]i)
32 3 19 unless ($$args{'Tier'} and $$args{'Tier'}->isa('Net::BitTorrent::Torrent::Tracker'))
40 6 13 $port ? :
42 12 7 if (not $host =~ /^(?:(?:(?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})[.]?){4})$/) { }
44 0 12 unless my($name, $aliases, $addrtype, $length, @addrs) = gethostbyname $host
76 0 16 unless ($_tier{refaddr $self}->_client->_udp)
81 15 1 if (defined $event)
82 1 14 unless ($event =~ /^(?:st(?:art|opp)|complet)ed$/)
89 15 0 if (not $_cid{refaddr $self}) { }
97 0 0 $_event{refaddr $self} eq 'stopped' ? :
0 0 $_event{refaddr $self} eq 'started' ? :
0 0 $_event{refaddr $self} eq 'completed' ? :
135 0 21 unless ($_tier{refaddr $self}->_client->_udp)
138 0 21 unless $self->_client->_udp
139 0 21 if ($_outstanding_requests{refaddr $self}{$tid}{'Attempt'} > 8)
143 0 21 unless (send $_tier{refaddr $self}->_client->_udp, $_outstanding_requests{refaddr $self}{$tid}{'Packet'}, 0, $_packed_host{refaddr $self})
158 20 1 $_event{refaddr $self} ? :
197 0 0 unless $_outstanding_requests{refaddr $self}{$tid}
202 0 0 if ($action == 0) { }
0 0 elsif ($action == 1) { }
0 0 elsif ($action == 2) { }
0 0 elsif ($action == 3) { }
204 0 0 if (length $data == 16)
213 0 0 if (length $data >= 20)
239 0 0 $min_interval ? :
271 0 15 if defined $_[1]
274 0 15 $_tid{refaddr $self} >= 11881376 ? :
281 1 0 !$advanced ? :
287 1 0 defined wantarray ? :
293 0 15 unless (eval { do { $return = pack('Q', $value); 1 } })
297 0 0 if ($i < 0) { }