Branch Coverage

lib/WWW/Crawler/Mojo/ScraperUtil.pm
Criterion Covered Total %
branch 51 58 87.9


line true false branch
14 4 8 if s/^(['"])//u
24 29 0 if (my $enc = &find_encoding($_))
33 0 28 unless $type
35 9 19 if $charset
36 18 1 if $type =~ qr"text/(html|xml)"u
37 1 0 if $type =~ qr"text/css"u
59 57 24 if $e->{'name'}
61 5 76 if ($e->tag eq 'select' and $name) { }
5 71 elsif ($e->tag eq 'textarea') { }
63 1 4 if (exists $e->{'multiple'}) { }
2 2 elsif (my $opts = $e->at('option[selected]')) { }
75 2 3 unless ($found)
87 12 69 unless my $type = $e->{'type'}
89 27 42 if (not $submit and grep {$_ eq $type;} 'submit', 'image')
91 6 21 if $name
93 47 22 if ($name)
94 23 24 if (grep {$_ eq $type;} 'text', 'hidden', 'number', 'password', 'date') { }
0 24 elsif (grep {$_ eq $type;} 'checkbox') { }
9 15 elsif (grep {$_ eq $type;} 'radio') { }
98 0 0 if exists $e->{'checked'}
101 3 6 if exists $e->{'checked'}
116 1 1 if $_[0] =~ qr/http\-equiv="?Refresh"?/iu and (($_[0]{'content'} || '') =~ qr/URL=(.+)/iu)[0]
133 1 22 ref $_[1] ? :
139 1 82 if $_[0]->xml and _wrong_dom_detection($_[0])
142 45 315 $cont ? :
150 0 174 ref $href ? :
151 168 6 ref $base ? :
163 5 13 unless my $head = ((shift()) =~ qr"(.+)"isu)[0]
176 1 1 if $dom->tag and $dom->tag eq 'script'