Branch Coverage

blib/lib/HTML/Restrict.pm
Criterion Covered Total %
branch 73 84 86.9


line true false branch
112 16 25 if ($rules)
114 1 16 if (lc $tag_name ne $tag_name)
117 16 0 if (&reftype($rules->{$tag_name}) eq "ARRAY")
120 7 19 ref $attr_item eq 'HASH' ? :
125 1 26 if lc $_ ne $_
139 0 185 if $self->debug
142 160 25 if (&any(sub { $_ eq $tagname; } , keys %{$self->get_rules;})) { }
4 21 elsif ($tagname eq 'img' and $self->replace_img) { }
4 17 elsif (&any(sub { $_ eq $tagname; } , @{$self->strip_enclosed_content;})) { }
143 0 160 if $self->debug
163 152 328 if ($link)
170 147 5 if (defined $url->scheme) { }
174 136 11 if &none(sub { $_ eq $url->scheme; } , grep({defined $_;} @{$self->get_uri_schemes;}))
179 1 4 unless grep {not defined $_;} @{$self->get_uri_schemes;}
186 13 168 if (ref $attr_item eq 'HASH') { }
196 2 11 if (ref $rule eq 'CODE') { }
8 3 elsif ($value =~ /$rule/) { }
199 1 1 unless defined $value
214 22 146 if (exists $attr->{$attr_name})
217 22 0 unless $attr_name eq "/"
224 0 160 if (exists $attr->{'/'} and $attr->{'/'} eq "/")
236 2 2 if (ref $self->replace_img) { }
242 2 0 defined $attr->{'alt'} ? :
250 0 4 if $self->debug
261 0 180 if $self->debug
262 159 21 if (&any(sub { $_ eq $tagname; } , keys %{$self->get_rules;})) { }
3 18 elsif (&any(sub { $_ eq $tagname; } , @{$self->_stripper_stack;})) { }
276 2 185 if $self->debug
277 1 186 if (ref $self->filter_text) { }
183 3 elsif ($self->filter_text) { }
283 185 2 if (not @{$self->_stripper_stack;})
293 0 6 if $self->debug
294 2 4 if ($self->allow_comments)
304 3 0 if $self->debug
305 2 1 if ($self->allow_declaration)
319 1 196 unless @_
320 2 194 unless $_[0]
323 0 194 unless ref \$content eq "SCALAR"
333 184 10 if ($self->trim and $text)
356 4 3 if ($tag eq $closing_tag and $found == 0)
394 1 6 defined $2 ? :
4 7 defined $1 ? :