Branch Coverage

blib/lib/Web/Scraper.pm
Criterion Covered Total %
branch 47 70 67.1


line true false branch
36 0 0 if @_
37 0 0 unless $self->{'user_agent'}
56 0 41 if (&blessed($stuff) and $stuff->isa('URI')) { }
3 38 elsif (&blessed($stuff) and $stuff->isa('HTML::Element')) { }
4 34 elsif (ref $stuff and ref $stuff eq 'SCALAR') { }
61 0 0 if ($res->is_success) { }
68 0 0 if defined $_
98 31 0 if (@keys == 1) { }
0 0 elsif (@keys) { }
113 31 6 if $retval
124 8 33 $exp =~ m[^/] ? :
130 3 37 if ($@)
134 0 37 unless @nodes
135 1 36 if $first
138 3 34 if (not defined $val) { }
5 29 elsif ($key =~ s/\[\]$//) { }
139 3 0 if (ref $key and ref $key eq 'CODE') { }
161 0 54 if (ref $val and ref $val eq 'CODE') { }
3 51 elsif (&blessed($val) and $val->isa('Web::Scraper')) { }
9 42 elsif ($val =~ s/^@//) { }
22 20 elsif (lc $val eq 'content' or lc $val eq 'text') { }
6 14 elsif (lc $val eq 'raw' or lc $val eq 'html') { }
3 11 elsif (ref $val eq 'HASH') { }
11 0 elsif (ref $val eq 'ARRAY') { }
168 5 4 if ($uri and is_link_element($node, $val))
174 3 19 $node->isTextNode ? :
176 1 5 if ($node->isTextNode)
210 8 5 if (ref $filter eq 'CODE') { }
5 0 elsif (not ref $filter) { }
214 0 5 $filter =~ s/^\+// ? :
215 0 5 unless ($module->isa('Web::Scraper::Filter'))
216 0 0 unless $module->require
226 0 13 if ($@)
231 7 6 if ($retval =~ /^\d+$/ and $_ ne $value or defined $retval and not $retval) { }
244 5 0 if $attr eq $elem