Condition Coverage

lib/Net/Netmask.pm
Criterion Covered Total %
condition 107 118 90.6


and 3 conditions

line !l l&&!r l&&r condition
64 678 788 7 $net =~ /^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/ and $mask =~ /[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/
678 782 6 $net =~ /^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/ and $mask =~ /0x[a-f0-9]+/i
678 12 770 $net =~ /^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/ and not $mask
680 4 6 $net =~ /^[0-9]+\.[0-9]+\.[0-9]+$/ and not $mask
684 4 2 $net =~ /^[0-9]+\.[0-9]+\.[0-9]+$/ and not $mask and $shortnet
674 6 8 $net =~ /^[0-9]+\.[0-9]+$/ and not $mask
680 6 2 $net =~ /^[0-9]+\.[0-9]+$/ and not $mask and $shortnet
676 6 4 $net =~ /^[0-9]+$/ and not $mask
682 2 2 $net =~ /^[0-9]+$/ and not $mask and $shortnet
678 4 2 $net =~ m[^([0-9]+\.[0-9]+\.[0-9]+)/([0-9]+)$] and $shortnet
676 4 2 $net =~ m[^([0-9]+\.[0-9]+)/([0-9]+)$] and $shortnet
676 2 2 $net =~ m[^([0-9]+)/([0-9]+)$] and $shortnet
122 2 2 8 defined $ibase and defined $end
126 4 4 4 not defined $Net::Netmask::error and !defined($bits) || $ibase & ~$imask[$bits]
146 1825 75 0 $Net::Netmask::error and $Net::Netmask::debug
149 602 1296 2 $proto eq 'IPv4' and $bits > 32
1296 600 2 $proto eq 'IPv6' and $bits > 128
407 18 12 5310 /^(([0-9])|([1-9][0-9]*))$/ && $_ < 256
832 1 1 1 $cidrs[0] and $cidrs[0]{'IBASE'} <= $max
858 15 9 25 $cidrs[0] and $cidrs[0]{'IBASE'} <= $max
884 0 10 2 $cidrs[0] and $cidrs[0]{'IBASE'} + $cidrs[0]->size < $first
886 8 0 16 @cidrs and $first <= $last
931 38 2 7793 $_[0]{'PROTOCOL'} eq 'IPv4' and $_[1]{'PROTOCOL'} eq 'IPv4'
2 2 36 $_[0]{'PROTOCOL'} eq 'IPv6' and $_[1]{'PROTOCOL'} eq 'IPv6'
962 2 4 8 defined $parts and $parts > 0

or 2 conditions

line l !l condition
124 10 2 $end || 0
10 2 $ibase || 0
159 1817 0 $base || '::'
714 5 3 $i & ~$this->{'IBASE'} || '0 '
720 3 3 $i - $this->{'IBASE'} || '0 '

or 3 conditions

line l !l&&r !l&&!r condition
56 6 21 1873 exists $options{'shortnet'} && $options{'shortnet'} || $SHORTNET_DEFAULT
64 4 1 673 $net eq 'default' or $net eq 'any'
4 0 59 $net eq 'default6' or $net eq 'any6'
126 2 2 4 !defined($bits) || $ibase & ~$imask[$bits]
159 10 73 1817 defined $ibase or $Net::Netmask::error
160 1803 73 24 defined $ibase or defined $Net::Netmask::error
872 4 0 0 'Net::Netmask'->new2($outer) || croak($Net::Netmask::error)
906 0 0 0 $Net::Netmask::a->{'IBASE'} <=> $Net::Netmask::b->{'IBASE'} || $Net::Netmask::a->{'BITS'} <=> $Net::Netmask::b->{'BITS'}
933 7756 15 22 $_[0]{'IBASE'} <=> $_[1]{'IBASE'} || $_[0]{'BITS'} <=> $_[1]{'BITS'}
936 11 12 13 $_[0]{'IBASE'} <=> $_[1]{'IBASE'} || $_[0]{'BITS'} <=> $_[1]{'BITS'}
945 0 63 1 $Net::Netmask::a->[3] cmp $Net::Netmask::b->[3] or $Net::Netmask::a->[1] <=> $Net::Netmask::b->[1]