Branch Coverage

blib/lib/Libravatar/URL.pm
Criterion Covered Total %
branch 47 54 87.0


line true false branch
109 1 20 unless $email
111 19 1 if ($email =~ /@([^\@]+)$/)
120 1 6 unless $openid
122 5 1 if ($openid =~ m[^(http|https)://([^/]+)]i)
131 1 7 unless scalar @records > 0
133 1 6 if (1 == scalar @records)
144 6 19 if ($rr->priority > $top_priority) { }
2 17 elsif ($rr->priority < $top_priority) { }
157 11 8 if ($rr->weight > 0) { }
166 2 4 if (1 == scalar @priority_records)
178 4 8 if ($weighted_index >= $random_number)
189 1 3 unless $target
191 0 3 $https ? :
192 1 1 if ($port and not $https and $port != 80 or $port and $https and $port != 443)
203 1 3 unless (defined $target and $target =~ /^[0-9a-zA-Z\-.]+$/)
206 1 2 unless (defined $port and $port =~ /^[0-9]{1,5}$/)
217 15 1 if (exists $args{'email'}) { }
0 1 elsif (exists $args{'openid'}) { }
223 1 15 unless $domain
227 1 14 $args{'https'} ? :
230 0 15 if ($packet and $packet->answer)
240 5 2 if ($openid =~ m[^([^:]+://[^/]+)(.*)])
251 0 1 unless exists $args{'email'} or exists $args{'openid'} or exists $args{'id'}
253 0 1 if (exists $args{'email'} and exists $args{'openid'} || exists $args{'id'} or exists $args{'openid'} and exists $args{'email'} || exists $args{'id'} or exists $args{'id'} and exists $args{'email'} || exists $args{'openid'})
263 16 3 unless ($custom_base)
265 0 16 if ($federated_url)
270 0 19 if (exists $args{'openid'})