Branch Coverage

blib/lib/Email/Valid.pm
Criterion Covered Total %
branch 62 140 44.2


line true false branch
75 55 4 ref $self ? :
76 1 58 unless @params
78 12 46 unless (@params > 1 and $params[0] =~ /^-/)
80 0 12 unless @names
98 3 0 ref $self ? :
3 10 unless @_
100 8 2 if ref $self
109 0 28 unless my $addr = $args{'address'}
110 0 28 if builtin::blessed($addr) and $addr->isa("Mail::Address")
112 3 25 if $addr =~ /\P{ASCII}/ or not $addr =~ /^$RFC822PAT$/o
125 0 0 if $^O eq "MSWin32" and -x "$file.exe" and not -d _
126 0 0 if -x $file and not -d _
135 2 0 unless $@
145 0 2 unless defined $Resolver
150 2 0 if (@mx_entries)
153 0 2 if ($nmx == 1 and $mx_entries[0]->exchange eq ".")
159 0 2 unless $query
161 2 0 unless $a_rr->type ne "A"
168 0 0 $ans ? :
170 0 0 if (@a_rrs)
172 0 0 unless $a_rr->type ne "A"
186 0 0 unless ($Nslookup_Path)
187 0 0 unless $Nslookup_Path = $self->_find_nslookup
192 0 0 if gethostbyname $host
195 0 0 if ($^O eq 'MSWin32' or $^O eq 'Cygwin') { }
201 0 0 if $?
202 0 0 if $Debug
203 0 0 unless $response =~ /$NSLOOKUP_PAT/io
207 0 0 if (my $fh = 'IO::File'->new('-|')) { }
209 0 0 if $Debug
211 0 0 unless $response =~ /$NSLOOKUP_PAT/io
214 0 0 unless open OLDERR, ">&STDERR"
215 0 0 unless open STDERR, ">&STDOUT"
230 0 0 unless (eval {
239 0 0 defined $invalid_tlds{$tld} ? :
247 0 2 unless my $host = $self->_host($args{"address"})
249 0 2 unless $DNS_Method
251 2 0 if ($DNS_Method eq 'Net::DNS') { }
0 0 elsif ($DNS_Method eq 'nslookup') { }
252 0 2 if $Debug
255 0 0 if $Debug
269 0 2 if builtin::blessed($addr) and $addr->isa("Mail::Address")
271 0 2 $addr =~ /^.*@(.*)$/ ? :
290 1 0 if $addr =~ /aol\.com$/i
291 0 1 if $addr =~ /compuserve\.com$/i
307 1 23 unless defined $localpart and length $localpart <= 64
315 0 21 unless $string and length $string <= 255
316 0 21 if $string =~ /\.\./
320 3 40 unless $self->_is_domain_label($label)
327 3 40 unless $string =~ /\A
344 0 28 unless my $addr = $args{'address'}
345 2 26 if builtin::blessed($addr) and $addr->isa("Mail::Address")
347 1 27 if $args{'fudge'}
348 3 25 unless $self->rfc822("-address", $addr)
352 0 25 unless $addr
354 1 24 if (length $addr->address > 254)
358 0 24 if ($args{'local_rules'})
359 0 0 unless $self->_local_rules($addr->user, $addr->host)
363 24 0 if ($args{'localpart'})
364 1 23 unless $self->_valid_local_part($addr->user) > 0
372 21 1 if (not $ip_ok and $args{'fqdn'})
375 5 16 unless $ip_ok or $domain_parts and $domain_parts > 1
379 0 17 if (not $ip_ok and $args{'tldcheck'})
380 0 0 unless $self->tld($addr->host)
383 2 16 if ($args{'mxcheck'})
386 0 2 unless $self->mx($addr->host)
389 0 18 wantarray ? :
398 1 0 if $name eq "DESTROY"
399 0 0 unless $AUTOLOAD{$name}
401 0 0 @_ ? :