Branch Coverage

blib/lib/Web/Mention.pm
Criterion Covered Total %
branch 87 108 80.5


line true false branch
171 2 39 if ($source->eq($target))
182 0 1 unless (&blessed($request) and $request->can('param'))
190 2 0 if (my $value = $request->param($_))
194 0 2 unless (defined $new_args{$_})
199 0 1 if (@complaints)
213 0 3 unless ($source)
244 25 2 if ($response->content =~ quotemeta($self->target) or $response->content =~ uri_escape($self->target)) { }
268 3 5 unless ($endpoint)
287 1 22 unless $self->is_verified
305 4 1 if ($self->source_mf2_document) { }
318 0 10 unless ($self->source_mf2_document)
323 0 10 unless $item
330 1 9 if ($self->rsvp_type and $self->_check_url_property($item, 'in-reply-to')) { }
1 8 elsif ($self->_check_url_property($item, 'repost-of')) { }
2 6 elsif ($self->_check_url_property($item, 'like-of')) { }
2 4 elsif ($self->_check_url_property($item, 'in-reply-to')) { }
1 3 elsif ($self->_check_url_property($item, 'quotation-of')) { }
362 10 0 if ($self->source_mf2_document)
366 1 9 unless ($item)
371 7 2 if ($item->get_property('content'))
374 7 2 if (defined $raw_content)
375 2 5 if (length $raw_content <= $self->max_content_length)
380 3 4 if (my $summary = $item->get_property('summary'))
384 2 2 if (defined $raw_content)
388 2 0 if (my $name = $item->get_property('name'))
399 10 0 if (my $item = $self->source_mf2_document->get_first('h-entry'))
400 1 9 if (my $rsvp_property = $item->get_property('rsvp'))
401 1 0 if (grep {$_ eq lc $rsvp_property;} @VALID_RSVP_TYPES)
419 3 25 if (&blessed($url_prop) and $url_prop->isa('Web::Microformats2::Item')) { }
426 7 21 if ($url eq $self->target)
438 0 8 unless (defined $content)
455 2 0 if ($self->source_mf2_document)
456 1 1 if (my $item = $self->source_mf2_document->get_first('h-entry'))
457 1 0 if (my $url = $item->get_property('url'))
469 2 0 if ($self->source_mf2_document)
470 1 1 if (my $item = $self->source_mf2_document->get_first('h-entry'))
471 1 0 if (my $time = $item->get_property('published'))
476 1 0 if $dt
493 2 6 if ($response->header('Link'))
497 1 1 if ($relation and $relation eq 'webmention')
504 7 1 unless ($endpoint)
505 6 1 if ($response->header('Content-type') =~ m[^text/html\b])
512 5 0 if defined $endpoint
517 2 6 unless defined $endpoint
522 1 5 if (lc $host eq 'localhost' or $host =~ /^127\.\d+\.\d+\.\d+$/) { }
538 5 0 if ($self->source_mf2_document)
541 4 1 if ($entry)
544 1 4 if ($entry and $name)
558 5 0 if ($title) { }
588 2 1 if ($self->is_tested)
597 2 0 if ($self->source_mf2_document) { }
619 5 1 if (defined $data_ref->{$_})
625 2 1 if ($data_ref->{'author'})
632 2 1 if (my $mf2_json = $data_ref->{'mf2_document_json'})