Branch Coverage

blib/lib/Net/Traceroute/PurePerl.pm
Criterion Covered Total %
branch 94 164 57.3


line true false branch
21 0 1 $^O eq 'MSWin32' ? :
54 0 1 if ($^O eq 'MSWin32' and $^V eq v5.8.6)
93 0 1034 unless $attr =~ /[^A-Z]/
94 0 1034 unless exists $Net::Traceroute::PurePerl::net_traceroute_native_var{$attr}
96 22 1012 if @_
122 0 1 if $useicmp
129 0 1 if ($useicmp)
131 0 0 if defined $self->protocol and $self->protocol ne 'icmp'
133 0 0 if $useicmp
137 1 0 if defined $host
138 0 1 unless defined $self->max_ttl
139 0 1 unless defined $self->queries
140 0 1 unless defined $self->base_port
141 0 1 unless defined $self->query_timeout
142 0 1 unless defined $self->packetlen
143 0 1 unless defined $self->first_hop
144 0 1 unless defined $self->concurrent_hops
147 0 1 unless defined $self->protocol
151 1 0 unless defined $self->use_alarm
168 3 2 if (defined $arg{$var})
199 0 0 unless ($self->hop_queries($hop))
207 0 0 if ($host and $resolve)
212 0 0 if ($host and !$lasthost || $host ne $lasthost)
214 0 0 if $lasthost and $host ne $lasthost
219 0 0 if (defined $time and $time > 0) { }
246 0 3 unless defined $self->host
254 1 2 unless defined $destination
269 0 2 unless socket $icmpsocket, 2, 3, getprotobyname 'icmp'
305 1 4 unless exists $Net::Traceroute::PurePerl::protocols{$self->protocol}
308 0 4 if $self->first_hop < 1 or $self->first_hop > 255
311 0 4 if $self->max_ttl < 1 or $self->max_ttl > 255
314 0 4 if $self->base_port < 1 or $self->base_port > 65280
317 0 4 if $self->packetlen < 40 or $self->packetlen > 1492
320 0 4 if $self->first_hop > $self->max_ttl
323 0 4 if $self->queries < 1 or $self->queries > 255
326 0 4 if $self->concurrent_hops < 1 or $self->concurrent_hops > 255
329 0 4 if $self->protocol ne 'icmp' and $^O eq 'MSWin32'
402 2 88 unless $nexttimeout
407 30 60 if ($currentquery == 0)
415 121 13 unless ($nfound)
419 106 15 if $timeout > 0.1
443 75 0 if (defined $from_saddr) { }
458 0 75 if ($from_proto != getprotobyname 'icmp')
468 0 75 unless ($icmp_data)
478 6 0 if ($from_type == 11 or $from_type == 3 or $self->protocol eq 'icmp' and $from_type == 0)
484 36 39 if ($self->protocol eq 'udp') { }
39 0 elsif ($self->protocol eq 'icmp') { }
495 3 33 $from_type == 3 ? :
499 3 36 if ($from_type == 0) { }
504 0 3 unless $icmp_id == $$
515 0 36 unless $icmp_id == $$
519 36 0 if ($ptype eq 8)
528 75 0 if ($from_ip and $from_id)
531 0 75 unless ($id)
536 0 75 unless (exists $packets{$id})
541 75 0 if ($packets{$id}{'id'} == $from_id)
543 0 75 if $self->protocol eq 'udp' and $packets{$id}{'localport'} != $local_port
550 75 0 if (not $endhop or $hop <= $endhop)
561 6 69 if ($last_hop or $endhop and $hop == $endhop)
577 14 120 if (keys %packets and $nexttimeout < time)
585 15 13 if ($packets{$id}{'timeout'} < time) { }
13 0 elsif (not defined $nexttimeout) { }
593 0 15 if ($endhop and $hop == $endhop)
616 2 132 if ($currenthop > $self->max_ttl and not keys %packets) { }
32 100 elsif ($end >= $self->queries) { }
627 0 94 if (not $hop or $endhop and $hop > $endhop)
633 0 32 unless (keys %packets)
656 1 1 if ($self->protocol eq 'icmp') { }
1 0 elsif ($self->protocol eq 'udp') { }
664 0 1 unless socket $socket, 2, 2, getprotobyname 'udp'
670 0 2 if ($self->device)
672 0 0 unless setsockopt $socket, 1, 25, pack('Z*', $self->device)
679 0 2 if ($self->source_address and $self->source_address ne '0.0.0.0')
696 0 0 unless defined $ip
699 0 0 unless bind $socket, sockaddr_in(0, $ip)
715 45 45 if ($self->protocol eq 'icmp') { }
45 0 elsif ($self->protocol eq 'udp') { }
759 45 45 unless $chksum
794 90 45 if ($self->protocol eq 'udp')
803 90 45 if ($self->protocol eq 'udp')
810 45 90 $self->protocol eq 'icmp' ? :
835 0 45 if $len_msg % 2