Branch Coverage

blib/lib/Email/Valid.pm
Criterion Covered Total %
branch 64 138 46.3


line true false branch
75 64 4 ref $self ? :
76 1 67 unless @params
78 15 52 unless (@params > 1 and $params[0] =~ /^-/)
80 0 15 unless @names
98 3 0 ref $self ? :
3 16 unless @_
100 14 2 if ref $self
109 0 31 unless my $addr = $args{'address'}
110 0 31 if &blessed($addr) and $addr->isa('Mail::Address')
112 3 28 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 5 unless defined $Resolver
150 2 3 if (@mx_entries)
154 0 2 unless $query
156 2 0 unless $a_rr->type ne 'A'
163 0 3 $ans ? :
165 0 3 if (@a_rrs)
167 0 0 unless $a_rr->type ne 'A'
181 0 0 unless ($Nslookup_Path)
182 0 0 unless $Nslookup_Path = $self->_find_nslookup
187 0 0 if gethostbyname $host
190 0 0 if ($^O eq 'MSWin32' or $^O eq 'Cygwin') { }
196 0 0 if $?
197 0 0 if $Debug
198 0 0 unless $response =~ /$NSLOOKUP_PAT/io
202 0 0 if (my $fh = 'IO::File'->new('-|')) { }
204 0 0 if $Debug
206 0 0 unless $response =~ /$NSLOOKUP_PAT/io
209 0 0 unless open OLDERR, '>&STDERR'
210 0 0 unless open STDERR, '>&STDOUT'
225 0 0 unless (eval { do { require Net::Domain::TLD; 'Net::Domain::TLD'->VERSION(1.65); 1 } })
234 0 0 defined $invalid_tlds{$tld} ? :
242 0 5 unless my $host = $self->_host($args{'address'})
244 0 5 unless $DNS_Method
246 5 0 if ($DNS_Method eq 'Net::DNS') { }
0 0 elsif ($DNS_Method eq 'nslookup') { }
247 0 5 if $Debug
250 0 0 if $Debug
264 0 5 if &blessed($addr) and $addr->isa('Mail::Address')
266 0 5 $addr =~ /^.*@(.*)$/ ? :
285 1 0 if $addr =~ /aol\.com$/i
286 0 1 if $addr =~ /compuserve\.com$/i
302 1 26 unless defined $localpart and length $localpart <= 64
310 0 24 unless $string and length $string <= 255
311 0 24 if $string =~ /\.\./
315 3 48 unless $self->_is_domain_label($label)
322 3 48 unless $string =~ /\A [A-Z0-9] # must start with an alnum (?: [-A-Z0-9]* # then maybe a dash or alnum [A-Z0-9] # finally ending with an alnum )? # lather, rinse, repeat \z/xi
339 0 31 unless my $addr = $args{'address'}
340 2 29 if &blessed($addr) and $addr->isa('Mail::Address')
342 1 30 if $args{'fudge'}
343 3 28 unless $self->rfc822(-'address', $addr)
347 0 28 unless $addr
349 1 27 if (length $addr->address > 254)
353 0 27 if ($args{'local_rules'})
354 0 0 unless $self->_local_rules($addr->user, $addr->host)
358 27 0 if ($args{'localpart'})
359 1 26 unless $self->_valid_local_part($addr->user) > 0
367 24 1 if (not $ip_ok and $args{'fqdn'})
370 5 19 unless $ip_ok or $domain_parts and $domain_parts > 1
374 0 20 if (not $ip_ok and $args{'tldcheck'})
375 0 0 unless $self->tld($addr->host)
378 5 16 if ($args{'mxcheck'})
381 3 2 unless $self->mx($addr->host)
384 0 18 wantarray ? :
393 0 0 if $name eq 'DESTROY'
394 0 0 unless $AUTOLOAD{$name}
396 0 0 @_ ? :