Branch Coverage

lib/Pcore/Util/URI/Host.pm
Criterion Covered Total %
branch 34 86 39.5


line true false branch
13 21 0 !$_[2] ? :
65 0 0 if (my $res = 'Pcore'->http->get('https://data.iana.org/TLD/tlds-alpha-by-domain.txt', 'buf_size', 0, 'on_progress', 0)) { }
68 0 0 if $_
87 0 0 if (my $res = 'Pcore'->http->get('https://publicsuffix.org/list/effective_tld_names.dat', 'buf_size', 0, 'on_progress', 0)) { }
101 0 0 if $domain_utf8 eq ''
120 0 0 if $label eq '*'
124 0 0 unless exists $suffixes->{$parent_ascii}
184 0 90 if ($self->name and $self->is_ipv4 || $self->is_ipv6) { }
193 9 92 if ($self->name and &AnyEvent::Socket::parse_ipv4(scalar $self->name)) { }
202 3 90 if ($self->name and &AnyEvent::Socket::parse_ipv6(scalar $self->name)) { }
211 0 64 if $self->name eq ''
213 0 64 $self->is_ip ? :
217 0 0 if $self->is_ip
219 0 0 if (my $name = $self->name)
220 0 0 if &bytes::length($name) > 255
222 0 0 if $name =~ /[^[:alnum:]._-]/msu
224 0 0 unless $name =~ /\A[[:alnum:]]/msu
226 0 0 unless $name =~ /[[:alnum:]]\z/msu
229 0 0 if &bytes::length($_) > 63
240 0 0 unless $self->is_domain
242 0 0 $self->tld eq $self->name ? :
246 0 0 if ($self->is_ip) { }
259 0 0 exists $self->tlds->{$self->tld} ? :
265 5 17 if $name and index($name, 'www.') == 0
275 0 39 unless $self->is_domain
277 12 27 length $self->pub_suffix == length $self->name ? :
284 0 64 unless $self->is_domain
290 64 0 if (my $name = $self->name)
291 14 50 if (exists $pub_suffixes->{$name}) { }
297 50 0 if (@labels > 1)
303 19 53 if (exists $$pub_suffixes{"*.$parent"})
306 14 5 unless (exists $$pub_suffixes{"!$subdomain"})
313 34 24 if (exists $pub_suffixes->{$parent})
319 2 22 if @labels == 1
329 0 0 if (my $pub_suffix = $self->pub_suffix) { }
338 0 2 unless $self->is_domain
340 1 1 length $self->root_domain eq length $self->name ? :
344 0 5 unless $self->is_domain
346 4 1 if (my $pub_suffix = $self->pub_suffix)
349 1 3 if length $pub_suffix >= length $canon
360 0 0 if (my $root_domain = $self->root_domain) { }
370 0 0 if (my $root_domain = $self->root_domain)
380 0 0 if (my $root_domain_utf8 = $self->root_domain_utf8)