| line |
true |
false |
branch |
|
25
|
20 |
10 |
if (tr[/][]) |
|
26
|
2 |
8 |
if (tr/\-//) |
|
27
|
0 |
8 |
if (UNIVERSAL::isa($_, "Net::CIDR::Lite")) |
|
38
|
26 |
7 |
unless %$self |
|
42
|
7 |
20 |
unless defined $mask and $mask =~ /\A(?:0|[1-9][0-9]*)\z/ and $mask <= $self->{'NBITS'} - 8 |
|
44
|
0 |
20 |
unless my $start = $self->{'PACK'}->($ip) & $self->{'MASKS'}[$mask] |
|
47
|
4 |
16 |
unless ++$self->{'RANGES'}{$start} |
|
48
|
0 |
20 |
unless --$self->{'RANGES'}{$end} |
|
54
|
3 |
6 |
unless $self->{'RANGES'} |
|
59
|
0 |
8 |
($total += $ranges->{$_}) ? : |
|
|
8 |
8 |
if ($total) { } |
|
67
|
1 |
4 |
unless $self->{'NBITS'} |
|
72
|
4 |
4 |
unless $total |
|
74
|
4 |
4 |
unless ($total) |
|
82
|
5 |
112 |
if $end le $ip |
|
89
|
4 |
0 |
wantarray ? : |
|
97
|
3 |
3 |
unless $total |
|
99
|
3 |
3 |
unless ($total) |
|
105
|
3 |
0 |
wantarray ? : |
|
117
|
6 |
6 |
unless $total |
|
123
|
6 |
6 |
unless ($total) |
|
128
|
3 |
7 |
if ($ip eq $start) |
|
141
|
3 |
4 |
if ($ip eq ($start & $self->{'MASKS'}[32])) { } |
|
153
|
3 |
0 |
wantarray ? : |
|
160
|
18 |
15 |
if (_pack_ipv4($ip)) { } |
|
|
6 |
9 |
elsif (_pack_ipv6($ip)) { } |
|
184
|
14 |
75 |
unless @nums == 4 |
|
186
|
6 |
259 |
unless /\A[0-9]{1,3}\z/ and not /\A0[0-9]{1,2}\z/ and $_ <= 255 |
|
198
|
0 |
32 |
if $ip =~ /\A:/ and not $ip =~ s/\A::/:/ |
|
199
|
0 |
32 |
if $ip =~ /:\z/ and not $ip =~ s/::\z/:/ |
|
201
|
0 |
32 |
unless @nums <= 8 |
|
204
|
0 |
111 |
if $ipv4 |
|
205
|
79 |
32 |
if /\A[a-fA-F0-9]{1,4}\z/ |
|
206
|
0 |
14 |
if $empty++ |
|
|
14 |
18 |
if $_ eq "" |
|
207
|
9 |
9 |
if $ipv4 = _pack_ipv4($_) |
|
210
|
0 |
23 |
if $ipv4 and @nums > 6 |
|
211
|
0 |
11 |
$ipv4 ? : |
|
|
4 |
19 |
unless $empty or @nums == ($ipv4 ? 6 : 8) |
|
212
|
9 |
3 |
$ipv4 ? : |
|
|
12 |
7 |
if $empty |
|
223
|
3 |
0 |
if (my(@runs) = $ip =~ /((?:(?:^|:)(?:0000))+:?)/g) |
|
226
|
0 |
0 |
if length $max < length $_ |
|
238
|
5 |
3 |
unless %$self |
|
239
|
0 |
5 |
unless my $start = $self->{'PACK'}->($ip) |
|
241
|
1 |
4 |
unless ++$self->{'RANGES'}{$start} |
|
242
|
0 |
5 |
unless --$self->{'RANGES'}{$end} |
|
251
|
0 |
3 |
if defined $crud |
|
252
|
2 |
1 |
unless %$self |
|
254
|
0 |
3 |
unless my $start = $self->{'PACK'}->($ip_start) |
|
256
|
0 |
3 |
unless my $end = $self->{'PACK'}->($ip_end) |
|
258
|
0 |
3 |
if $start gt $end |
|
260
|
0 |
3 |
unless ++$self->{'RANGES'}{$start} |
|
261
|
0 |
3 |
unless --$self->{'RANGES'}{$end} |
|
269
|
0 |
0 |
unless UNIVERSAL::isa($cidr, "Net::CIDR::Lite") |
|
270
|
0 |
0 |
unless (%$self) |
|
287
|
4 |
379 |
if $bits < 0 |
|
306
|
4 |
6 |
unless $self->{'FIND'} |
|
307
|
0 |
10 |
unless @{$self->{'FIND'};} < $self->{'PCT'} |
|
308
|
1 |
9 |
unless $self->{'PACK'} |
|
313
|
6 |
11 |
if $this_ip lt $ip |
|
322
|
1 |
3 |
unless $self->{'FIND'} |
|
325
|
2 |
2 |
unless $ip ge $find->[$start] and $ip lt $find->[$end] |
|
328
|
2 |
2 |
if ($start == $mid) { } |
|
329
|
1 |
1 |
if ($find->[$end] eq $ip) { } |
|
333
|
1 |
1 |
$find->[$mid] lt $ip ? : |
|
372
|
2 |
1 |
if (@_ and not $self->{'PACK'}) |
|
374
|
0 |
2 |
unless ref $cidr |
|
380
|
1 |
2 |
unless ref $cidr |
|
395
|
2 |
2 |
unless $self->{'FIND'} |
|
396
|
0 |
4 |
unless @_ |
|
397
|
1 |
3 |
unless @{$self->{'FIND'};} |
|
398
|
1 |
2 |
if @_ / @{$self->{'FIND'};} < $self->{'PCT'} |
|
399
|
0 |
3 |
unless &$pack($_) |
|
402
|
3 |
2 |
if ($ips[0] lt $ip) |
|
406
|
2 |
3 |
unless @ips |
|
409
|
0 |
2 |
if (@ips) |
|
418
|
0 |
1 |
unless @_ |
|
419
|
0 |
1 |
unless $self->{'FIND'} |
|
420
|
0 |
1 |
unless @{$self->{'FIND'};} |
|
425
|
0 |
1 |
unless &$pack($_) |
|
427
|
0 |
1 |
unless $ip ge $find->[$start] and $ip lt $find->[$end] |
|
431
|
1 |
1 |
if ($start == $mid) { } |
|
432
|
1 |
0 |
if ($find->[$end] eq $ip) { } |
|
436
|
0 |
1 |
$find->[$mid] lt $ip ? : |
|
473
|
0 |
0 |
unless ($self->{'PACK'}) |