Branch Coverage

blib/lib/Metabrik/Network/Address.pm
Criterion Covered Total %
branch 0 154 0.0


line true false branch
74 0 0 unless my $init = $self->SUPER::brik_init
90 0 0 unless $self->brik_help_run_undef_arg('match', $subnet)
92 0 0 unless ($self->is_ip($ip) and $self->is_ip($subnet))
96 0 0 if ($self->is_ipv4($ip) and not $self->is_ipv4($subnet))
101 0 0 if ($self->is_ipv6($ip) and not $self->is_ipv6($subnet))
110 0 0 if ($@)
116 0 0 if ($r) { }
133 0 0 unless $self->brik_help_run_undef_arg('network_address', $subnet)
135 0 0 unless ($self->is_ipv4($subnet))
149 0 0 unless $self->brik_help_run_undef_arg('broadcast_address', $subnet)
151 0 0 unless ($self->is_ipv4($subnet))
165 0 0 unless $self->brik_help_run_undef_arg('netmask_address', $subnet)
178 0 0 unless $self->brik_help_run_undef_arg('range_to_cidr', $first)
179 0 0 unless $self->brik_help_run_undef_arg('range_to_cidr', $last)
181 0 0 if ($self->is_ip($first) and $self->is_ip($last))
187 0 0 if ($@)
203 0 0 unless $self->brik_help_run_undef_arg('is_ip', $ip)
205 0 0 if ($self->is_ipv4($ip) or $self->is_ipv6($ip))
216 0 0 unless $self->brik_help_run_undef_arg('is_rfc1918', $ip)
218 0 0 unless ($self->is_ipv4($ip))
229 0 0 if ($@)
234 0 0 $is ? :
241 0 0 unless $self->brik_help_run_undef_arg('is_ipv4', $ip)
247 0 0 if ($local =~ /$ipv4_re/)
258 0 0 unless $self->brik_help_run_undef_arg('is_ipv6', $ip)
264 0 0 if ($local =~ /$ipv6_re/)
275 0 0 unless $self->brik_help_run_undef_arg('netmask_to_cidr', $netmask)
282 0 0 if ($@)
298 0 0 unless $self->brik_help_run_undef_arg('ipv4_list', $subnet)
300 0 0 unless ($self->is_ipv4($subnet))
307 0 0 unless my $a = $self->network_address($subnet)
308 0 0 unless my $m = $self->netmask_address($subnet)
315 0 0 if ($@)
333 0 0 unless $self->brik_help_run_undef_arg('ipv6_list', $subnet)
335 0 0 unless ($self->is_ipv6($subnet))
350 0 0 if ($@)
368 0 0 unless $self->brik_help_run_undef_arg('get_ipv4_cidr', $subnet)
371 0 0 unless (defined $cidr)
375 0 0 if ($cidr < 0 or $cidr > 32)
387 0 0 unless $self->brik_help_run_undef_arg('get_ipv6_cidr', $subnet)
390 0 0 unless (defined $cidr)
394 0 0 if ($cidr < 0 or $cidr > 128)
406 0 0 unless $self->brik_help_run_undef_arg('count_ipv4', $subnet)
408 0 0 unless ($self->is_ipv4($subnet))
412 0 0 unless my $cidr = $self->get_ipv4_cidr($subnet)
422 0 0 unless $self->brik_help_run_undef_arg('count_ipv6', $subnet)
424 0 0 unless ($self->is_ipv6($subnet))
428 0 0 unless my $cidr = $self->get_ipv6_cidr($subnet)
438 0 0 unless $self->brik_help_run_undef_arg('is_ipv4_subnet', $subnet)
441 0 0 unless (defined $address and defined $cidr)
446 0 0 if ($cidr < 0 or $cidr > 32)
458 0 0 unless $self->brik_help_run_undef_arg('merge_cidr', $list)
459 0 0 unless $self->brik_help_run_invalid_arg('merge_cidr', $list, 'ARRAY')
463 0 0 unless @list = Net::CIDR::cidradd(@$list)
465 0 0 if ($@)
477 0 0 unless $self->brik_help_run_undef_arg('ipv4_to_integer', $ipv4_address)
479 0 0 unless ($self->is_ipv4($ipv4_address))
492 0 0 unless $self->brik_help_run_undef_arg('ipv6_to_integer', $ipv6_address)
494 0 0 unless ($self->is_ipv6($ipv6_address))
510 0 0 unless $self->brik_help_run_undef_arg('integer_to_ipv4', $integer)
565 0 0 unless $self->brik_help_run_undef_arg('is_ipv4_reserved', $ip)
567 0 0 unless ($self->is_ipv4($ip))
574 0 0 if ($self->match($ip, $_))
587 0 0 unless $self->brik_help_run_undef_arg('is_ipv6_reserved', $ip)
589 0 0 unless ($self->is_ipv6($ip))
596 0 0 if ($self->match($ip, $_))
609 0 0 unless $self->brik_help_run_undef_arg('is_ip_reserved', $ip)
611 0 0 unless ($self->is_ip($ip))
616 0 0 if ($self->is_ipv4($ip)) { }
625 0 0 if ($self->match($ip, $_))
638 0 0 unless $self->brik_help_run_undef_arg('ipv6_to_string_preferred', $ip)
640 0 0 unless ($self->is_ipv6($ip))
648 0 0 if ($@)
674 0 0 unless $self->brik_help_run_undef_arg('ipv6_first_address', $ip)
676 0 0 unless ($self->is_ipv6($ip))
691 0 0 unless $self->brik_help_run_undef_arg('ipv6_last_address', $ip)
693 0 0 unless ($self->is_ipv6($ip))