Branch Coverage

blib/lib/Mojolicious/Plugin/WebFinger.pm
Criterion Covered Total %
branch 27 124 21.7


line true false branch
32 0 1 if (my $config_param = $mojo->config('WebFinger'))
39 1 0 unless (exists $mojo->renderer->helpers->{'hostmeta'})
52 0 1 if ($param->{'expires'} and $param->{'expires'} =~ /^\d+$/u)
75 0 5 if ($param->{'secure'} and not $c->req->is_secure)
85 0 5 if (not $res or $res eq '{uri}')
92 3 0 unless ($c->stash('format') or scalar $c->param('_format') or scalar $c->param('format'))
103 0 5 unless $nres
106 3 2 if ($c->callback('prepare_webfinger', $nres))
109 0 3 if $c->res->body
115 3 0 if ($xrd)
118 3 0 unless ($expires = $xrd->expires && $seconds)
123 3 0 if ($expires)
187 0 2 if ($_[1] and not ref $_[1] and index($_[1], '-') != 0) { }
208 0 2 if ($host and $host =~ /(?:gmail|yahoo|mozilla)\.(?:com|org|net)$/iu)
209 0 0 unless $flag{'-modern'}
213 0 2 defined $_[-1] && ref $_[-1] eq 'CODE' ? :
217 0 0 if ($_[0] and ref $_[0] and ref $_[0] eq 'HASH')
225 2 0 if (not $host or $host eq ($c->req->url->base->host || 'localhost'))
228 2 0 if ($c->callback('prepare_webfinger', $nres)) { }
234 0 2 wantarray ? :
0 2 $cb ? :
239 0 0 $cb ? :
255 0 0 if ($xrd)
258 0 0 if $rel
261 0 0 if $cb or wantarray
265 0 0 wantarray ? :
0 0 $cb ? :
271 0 0 $cb ? :
0 0 unless $host and $res
275 0 0 if (exists $flag{'-secure'} or exists $flag{'-modern'})
281 0 0 if $secure
284 0 0 if ($cb)
290 0 0 unless (exists $flag{'-old'})
311 0 0 if ($xrd)
320 0 0 if $rel
327 0 0 if exists $flag{'-modern'}
349 0 0 if $secure
361 0 0 if not $xrd or $xrd->expired
364 0 0 unless my $template = _get_lrdd($xrd)
382 0 0 unless $xrd
391 0 0 if $rel
401 0 0 unless 'Mojo::IOLoop'->is_running
408 0 0 unless (exists $flag{'-old'})
415 0 0 unless ($xrd)
418 0 0 if exists $flag{'-modern'}
421 0 0 $secure ? :
0 0 unless $xrd = $c->hostmeta($host, $header, ['lrdd'], $secure ? '-secure' : undef)
429 0 0 if $xrd->expired
432 0 0 unless my $template = _get_lrdd($xrd)
442 0 0 unless ($xrd, $headers) = $c->get_xrd($lrdd, $header)
452 0 0 if $rel
455 0 0 wantarray ? :
465 0 5 unless $nres
477 2 3 if $res ne $nres
485 0 5 if $c->param('rel')
495 0 7 unless $res
498 0 7 if (index($res, 'acct:') != 0 and $res =~ /^[^:]+:/u)
500 0 0 unless wantarray
509 0 0 if wantarray
524 7 0 wantarray ? :
533 0 0 unless my $lrdd = $xrd->link('lrdd')
536 0 0 unless $lrdd->attr('template')