Branch Coverage

blib/lib/Mail/SpamAssassin/NetSet.pm
Criterion Covered Total %
branch 66 104 63.4


line true false branch
47 60 381 unless defined $netset_name
52 0 441 if $have_patricia
62 86 235 if (exists $self->{'cache'})
66 86 0 if $attempts > 0
89 10 610 $cidr =~ s/^!\s*// ? :
92 329 291 if $cidr =~ s[ / (.*) \z ][]sx
95 0 620 if $cidr =~ /^ \[ ( [^\]]* ) \] \z/sx
99 0 620 if ($cidr =~ s/ % ( [A-Z0-9._~-]* ) \z //six)
107 344 276 if ($cidr =~ /^ \d+ (\. | \z) /x)
108 270 74 if ($cidr =~ /^ (\d+) \. (\d+) \. (\d+) \. (\d+) \z/x) { }
8 66 elsif ($cidr =~ /^ (\d+) \. (\d+) \. (\d+) \.? \z/x) { }
35 31 elsif ($cidr =~ /^ (\d+) \. (\d+) \.? \z/x) { }
31 0 elsif ($cidr =~ /^ (\d+) \.? \z/x) { }
111 18 252 unless defined $masklen
114 2 6 unless defined $masklen
117 2 33 unless defined $masklen
120 8 23 unless defined $masklen
128 0 620 if ($self->{'pt'})
129 0 0 if (defined $masklen)
130 0 0 unless $masklen =~ /^\d{1,3}\z/
135 0 0 if ($is_ip4)
137 0 0 if defined $prefix_len
139 0 0 unless defined $prefix_len
143 0 0 unless defined eval {
144 0 0 $exclude ? :
149 359 261 if defined $masklen
152 0 620 unless (defined $ip)
160 344 276 if ($is_ip4) { }
170 620 0 if (scalar @{$self->{'nets'};} < 200)
171 8 612 if $self->is_net_declared($ip4, $ip6, $exclude, 0)
197 0 428 unless $cidr =~ m[^\d+[./]]
199 84 344 unless ($cidr =~ m[/])
210 0 344 unless (defined $ip6 and $ip6 =~ /^0:0:0:0:0:0:(.*)$/)
221 0 665 unless defined $self->{'nets'}
227 47 418 if ($in4 or $in6)
231 5 3 $exclude ? :
1 7 $net->{'exclude'} ? :
8 39 unless $quiet
234 1 38 if not $declared and $net->{'exclude'}
251 22 117 unless ($self->{'num_nets'})
254 17 100 if ($self->{'cache'} and exists $self->{'cache'}{$ip}) { }
0 100 elsif ($self->{'pt'}) { }
264 0 0 if /^ \[ ( [^\]]* ) \] \z/sx
266 0 0 if (/^ (\d+) \. (\d+) \. (\d+) \. (\d+) \z/x) { }
271 0 0 unless eval {
272 0 0 defined $result && !($result =~ /^!/) ? :
279 84 16 if ($ip =~ /^\d+\./) { }
286 70 126 if (defined $ip4 and defined $net->{'ip4'} and $net->{'ip4'}->contains($ip4) or defined $ip6 and defined $net->{'ip6'} and $net->{'ip6'}->contains($ip6))
310 0 291 if (exists $self->{'cache'})
319 6 3 if ($self->{'nets'})
322 0 9 if ($self->{'pt'})
326 0 0 unless defined eval {