Branch Coverage

blib/lib/HTML/StripTags.pm
Criterion Covered Total %
branch 98 120 81.6


line true false branch
65 1 160 if (scalar @_ == 0)
69 1 159 if (scalar @_ > 2)
73 21 138 if (ref $string ne 'STRING' and ref $string ne '')
77 4 134 if (ref $allow eq 'ARRAY')
83 130 4 defined $string ? :
84 130 4 defined $string ? :
98 82 52 if ($allow)
104 4 5616 if (&Switch::case("\000"))
107 438 5178 if (&Switch::case('<'))
108 3 435 if ($in_q)
111 3 432 if ($buf[$p + 1] =~ /\s/)
114 420 12 if ($state == 0) { }
8 4 elsif ($state == 1) { }
117 329 91 if ($allow)
125 4 5177 if (&Switch::case('('))
126 0 4 if ($state == 2) { }
0 4 elsif ($allow and $state == 1) { }
4 0 elsif ($state == 0) { }
127 0 0 if ($lc ne '"' and $lc ne q['])
138 4 5173 if (&Switch::case(')'))
139 0 4 if ($state == 2) { }
0 4 elsif ($allow and $state == 1) { }
4 0 elsif ($state == 0) { }
140 0 0 if ($lc ne '"' and $lc ne q['])
151 440 4733 if (&Switch::case('>'))
152 8 432 if ($depth)
157 3 429 if ($in_q)
162 344 85 if (&Switch::case(1))
165 278 66 if ($allow)
167 72 206 if ($allow =~ join('', join('', map(lc($_), @tbuf)) =~ m[(<)/?(\S+)(?:.*)(>)]))
174 58 27 if (&Switch::case(2))
175 53 5 if (not $br and $lc ne '"' and $buf[$p - 1] eq '?')
181 0 27 if (&Switch::case(3))
186 24 3 if (&Switch::case(4))
187 23 1 if ($p >= 2 and $buf[$p - 1] eq '-' and $buf[$p - 2] eq '-')
193 3 0 if (&Switch::case(qr/\d/))
200 45 4688 if (&Switch::case(qr/\'|\"/))
201 0 45 if ($state == 4) { }
2 43 elsif ($state == 2 and $buf[$p - 1] ne '\\') { }
9 34 elsif ($state == 0) { }
18 32 elsif ($allow and $state == 1) { }
206 1 1 if ($lc eq $c) { }
1 0 elsif ($lc ne '\\') { }
218 32 0 if ($state and $p != 0 and $state == 1 || $buf[$p - 1] ne '\\' and !$in_q || $buf[$p] eq $in_q)
219 16 16 if ($in_q) { }
227 36 4652 if (&Switch::case('!'))
229 23 13 if ($state == 1 and $buf[$p - 1] eq '<') { }
233 13 0 if ($state == 0) { }
0 0 elsif ($allow and $state == 1) { }
241 100 4552 if (&Switch::case('-'))
242 23 77 if ($state == 3 and $p >= 2 and $buf[$p - 1] eq '-' and $buf[$p - 2] eq '!') { }
250 118 4511 if (&Switch::case('?'))
251 53 65 if ($state == 1 and $buf[$p - 1] eq '<')
258 297 4279 if (&Switch::case(qr/E|e/))
260 0 0 if ($state == 3 and $p > 6 and lc $buf[$p - 1] eq 'p' and lc $buf[$p - 2] eq 'y' and lc $buf[$p - 3] eq 't' and lc $buf[$p - 4] eq 'c' and lc $buf[$p - 5] eq 'o' and lc $buf[$p - 6] eq 'd')
273 451 4125 if (&Switch::case(qr/L|l/))
274 0 107 if ($state == 2 and $p > 2 and lc join('', ($buf[$p - 2], $buf[$p - 1])) eq 'xm')
281 4576 0 if (&Switch::case(qr/.*/))
282 2115 2461 if ($state == 0) { }
958 2158 elsif ($allow and $state == 1) { }