Branch Coverage

blib/lib/Email/Valid.pm
Criterion Covered Total %
branch 63 136 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 if (@a_rrs)
165 0 0 unless $a_rr->type ne 'A'
179 0 0 unless ($Nslookup_Path)
180 0 0 unless $Nslookup_Path = $self->_find_nslookup
185 0 0 if gethostbyname $host
188 0 0 if ($^O eq 'MSWin32' or $^O eq 'Cygwin') { }
194 0 0 if $?
195 0 0 if $Debug
196 0 0 unless $response =~ /$NSLOOKUP_PAT/io
200 0 0 if (my $fh = 'IO::File'->new('-|')) { }
202 0 0 if $Debug
204 0 0 unless $response =~ /$NSLOOKUP_PAT/io
207 0 0 unless open OLDERR, '>&STDERR'
208 0 0 unless open STDERR, '>&STDOUT'
223 0 0 unless (eval { do { require Net::Domain::TLD; 'Net::Domain::TLD'->VERSION(1.65); 1 } })
232 0 0 defined $invalid_tlds{$tld} ? :
240 0 5 unless my $host = $self->_host($args{'address'})
242 0 5 unless $DNS_Method
244 5 0 if ($DNS_Method eq 'Net::DNS') { }
0 0 elsif ($DNS_Method eq 'nslookup') { }
245 0 5 if $Debug
248 0 0 if $Debug
262 0 5 if &blessed($addr) and $addr->isa('Mail::Address')
264 0 5 $addr =~ /^.*@(.*)$/ ? :
283 1 0 if $addr =~ /aol\.com$/i
284 0 1 if $addr =~ /compuserve\.com$/i
300 1 26 unless defined $localpart and length $localpart <= 64
308 0 24 unless $string and length $string <= 255
309 0 24 if $string =~ /\.\./
313 3 48 unless $self->_is_domain_label($label)
320 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
337 0 31 unless my $addr = $args{'address'}
338 2 29 if &blessed($addr) and $addr->isa('Mail::Address')
340 1 30 if $args{'fudge'}
341 3 28 unless $self->rfc822(-'address', $addr)
345 0 28 unless $addr
347 1 27 if (length $addr->address > 254)
351 0 27 if ($args{'local_rules'})
352 0 0 unless $self->_local_rules($addr->user, $addr->host)
356 27 0 if ($args{'localpart'})
357 1 26 unless $self->_valid_local_part($addr->user) > 0
365 24 1 if (not $ip_ok and $args{'fqdn'})
368 5 19 unless $ip_ok or $domain_parts and $domain_parts > 1
372 0 20 if (not $ip_ok and $args{'tldcheck'})
373 0 0 unless $self->tld($addr->host)
376 5 16 if ($args{'mxcheck'})
379 3 2 unless $self->mx($addr->host)
382 0 18 wantarray ? :
391 0 0 if $name eq 'DESTROY'
392 0 0 unless $AUTOLOAD{$name}
394 0 0 @_ ? :