Condition Coverage

blib/lib/Net/BitTorrent/Peer.pm
Criterion Covered Total %
condition 77 217 35.4


and 3 conditions

line !l l&&!r l&&r condition
155 0 67 0 $$args{'Client'} and blessed($$args{'Client'})
0 67 0 $$args{'Client'} and blessed($$args{'Client'}) and $$args{'Client'}->isa('Net::BitTorrent')
166 65 2 0 defined $ok and $ok == 0
169 134 0 406 $$_{'Object'}->isa('Net::BitTorrent::Peer') and $$_{'Object'}->host
134 0 406 $$_{'Object'}->isa('Net::BitTorrent::Peer') and $$_{'Object'}->host and $$_{'Object'}->host eq $ip
0 0 406 $$_{'Object'}->isa('Net::BitTorrent::Peer') and $$_{'Object'}->host and $$_{'Object'}->host eq $ip and $$_{'Object'}->port
207 0 68 0 $$args{'Torrent'} and blessed($$args{'Torrent'})
0 68 0 $$args{'Torrent'} and blessed($$args{'Torrent'}) and $$args{'Torrent'}->isa('Net::BitTorrent::Torrent')
234 136 0 351 $$_{'Object'}->isa('Net::BitTorrent::Peer') and $$_{'Object'}->host
136 0 351 $$_{'Object'}->isa('Net::BitTorrent::Peer') and $$_{'Object'}->host and $$_{'Object'}->host eq $_host
0 0 351 $$_{'Object'}->isa('Net::BitTorrent::Peer') and $$_{'Object'}->host and $$_{'Object'}->host eq $_host and $$_{'Object'}->port
275 0 35 32 $_client{refaddr $self}->_encryption_mode != 0 and not $$args{'_plaintext'}
322 6 0 12 not $incoming{refaddr $self} and $torrent{refaddr $self}
6 7 5 not $incoming{refaddr $self} and $torrent{refaddr $self} and $_state{refaddr $self} < REG_ONE()
421 819 3838 0 defined $torrent{refaddr $self} and not $torrent{refaddr $self}->status & 1
432 819 3838 0 defined $torrent{refaddr $self} and $torrent{refaddr $self}->status & 2
440 322 0 0 $_crypto_select{refaddr $self} == CRYPTO_RC4() and $_state{refaddr $self} >= REG_ONE()
481 6 4326 306 $write and $_data_out{refaddr $self}
509 486 0 0 $_crypto_select{refaddr $self} == CRYPTO_RC4() and $_state{refaddr $self} >= REG_ONE()
853 0 0 28 $VC and $crypto_provide
1079 76 177 190 $$_{'Object'}->isa('Net::BitTorrent::Peer') and $$_{'Object'}->peerid
1191 0 0 0 defined $torrent{refaddr $self} and not $torrent{refaddr $self}->status & 1
1214 0 0 0 defined $torrent{refaddr $self} and not $torrent{refaddr $self}->status & 1
1245 0 17 0 defined $torrent{refaddr $self} and not $torrent{refaddr $self}->status & 1
1269 0 17 0 defined $torrent{refaddr $self} and not $torrent{refaddr $self}->status & 1
1295 0 2 0 defined $torrent{refaddr $self} and not $torrent{refaddr $self}->status & 1
1321 0 24 0 defined $torrent{refaddr $self} and not $torrent{refaddr $self}->status & 1
1335 24 0 0 not unpack('b*', ${$bitfield{refaddr $self};}) =~ /1/ and $torrent{refaddr $self}->is_complete
1342 12 12 0 ${$am_interested{refaddr $self};} and not ${$peer_choking{refaddr $self};}
1356 0 0 0 defined $torrent{refaddr $self} and not $torrent{refaddr $self}->status & 1
1370 0 0 0 not unpack('b*', ${$bitfield{refaddr $self};}) =~ /1/ and $torrent{refaddr $self}->is_complete
1387 0 5 0 defined $torrent{refaddr $self} and not $torrent{refaddr $self}->status & 1
1423 0 3 0 defined $torrent{refaddr $self} and not $torrent{refaddr $self}->status & 1
1434 0 0 3 $$_{'Index'} == $index and $$_{'Offset'} == $offset
1474 0 0 0 defined $requests_out{refaddr $peer}[$x] and $requests_out{refaddr $peer}[$x]{'Index'} == $index
0 0 0 defined $requests_out{refaddr $peer}[$x] and $requests_out{refaddr $peer}[$x]{'Index'} == $index and $requests_out{refaddr $peer}[$x]{'Offset'} == $offset
0 0 0 defined $requests_out{refaddr $peer}[$x] and $requests_out{refaddr $peer}[$x]{'Index'} == $index and $requests_out{refaddr $peer}[$x]{'Offset'} == $offset and $requests_out{refaddr $peer}[$x]{'Length'} == $length
1504 0 0 3 $torrent{refaddr $self}->_check_piece_by_index($index) and defined $torrent{refaddr $self}
1524 0 0 0 defined $torrent{refaddr $self} and not $torrent{refaddr $self}->status & 1
1542 0 0 0 $requests_in{refaddr $self}[$x]{'Index'} == $index and $requests_in{refaddr $self}[$x]{'Offset'} == $offset
0 0 0 $requests_in{refaddr $self}[$x]{'Index'} == $index and $requests_in{refaddr $self}[$x]{'Offset'} == $offset and $requests_in{refaddr $self}[$x]{'Length'} == $length
1580 0 6 0 ${$am_interested{refaddr $self};} and not ${$peer_choking{refaddr $self};}
1636 0 0 0 $$_{'Index'} == $index and $$_{'Offset'} == $offset
1679 0 47 0 defined $torrent{refaddr $self} and not $torrent{refaddr $self}->status & 1
1689 0 47 0 defined $_client{refaddr $self}->_dht and defined $$packet{'p'}
1728 54 1 17 $interesting and not ${$am_interested{refaddr $self};}
1 51 3 not $interesting and ${$am_interested{refaddr $self};}
1755 0 0 0 ${$peer_choking{refaddr $self};} and ${$am_interested{refaddr $self};}
1760 0 0 0 ${$peer_choking{refaddr $self};} and not ${$am_interested{refaddr $self};}
0 0 0 ${$peer_choking{refaddr $self};} and not ${$am_interested{refaddr $self};} and not ${$peer_interested{refaddr $self};}
1866 0 0 0 $_ < 5 && $$piece{'Blocks_Received'}[$tmp_index] == 0
1877 0 0 0 $$piece{'Index'} == $$_{'Index'} and $index == $$_{'_vec_offset'}
1963 15 0 50 scalar @have == 0 and ord substr($reserved_bytes{refaddr $self}, 7, 1) & 4
4 0 11 scalar @have == $self->torrent->piece_count and ord substr($reserved_bytes{refaddr $self}, 7, 1) & 4
2001 0 65 0 defined $torrent{refaddr $self} and not $torrent{refaddr $self}->status & 1
2044 0 0 0 defined $torrent{refaddr $self} and not $torrent{refaddr $self}->status & 1
2077 0 5 0 defined $torrent{refaddr $self} and not $torrent{refaddr $self}->status & 1
2084 0 5 0 defined $torrent{refaddr $self} and $torrent{refaddr $self}->status & 32
2088 0 5 5 length $_data_out{refaddr $self} < 262144 and @{$requests_in{refaddr $self};}
2135 0 0 0 defined $torrent{refaddr $self} and $torrent{refaddr $self}->status & 2
2162 0 17 0 defined $torrent{refaddr $self} and $torrent{refaddr $self}->status & 2

or 2 conditions

line l !l condition
2256 0 0 $self->host || ''
0 0 $self->port || ''

or 3 conditions

line l !l&&r !l&&!r condition
141 67 0 68 $$args{'Socket'} or $$args{'Address'}
293 67 0 67 ${$bitfield{refaddr $self};} ||= ()
955 0 0 18 not $VC or $VC ne VC()
1445 0 0 3 $$_{'Index'} != $index or $$_{'Offset'} != $offset
1647 0 0 0 $$_{'Index'} != $index or $$_{'Offset'} != $offset
1800 0 0 0 not $$piece{'Touch'} or $$piece{'Touch'} <= time - 180
1877 0 0 0 $$piece{'Blocks_Received'}[$index] or $$piece{'Index'} == $$_{'Index'} and $index == $$_{'_vec_offset'}
1901 13 0 5 not defined $vec_offset or $vec_offset == -1
1913 0 5 0 $$piece{'Length'} % $$piece{'Block_Length'} || $$piece{'Block_Length'}
2316 176 0 208 $reset or not $_RC4_S{refaddr $self}{$pass}