Branch Coverage

blib/lib/HTML/FillInForm.pm
Criterion Covered Total %
branch 177 194 91.2


line true false branch
24 0 57 unless eval "require $parser_class;"
29 0 57 unless ($self->can('attr_encoded'))
65 12 47 unless ref $self
70 9 50 if (ref $_[0] eq 'SCALAR') { }
1 49 elsif (ref $_[0] eq 'ARRAY') { }
1 48 elsif (ref $_[0] eq 'GLOB') { }
0 48 elsif (ref $_[0]) { }
1 47 elsif (not _known_keys()->{$_[0]}) { }
94 8 51 if (ref $_[0])
96 8 0 unless ref $data eq 'ARRAY'
99 6 2 if (ref $source eq 'HASH') { }
2 0 elsif (ref $source) { }
0 0 elsif (defined $source) { }
103 2 0 if ($source->can('param')) { }
123 6 53 if (ref $option{'fdat'} eq 'ARRAY')
136 2 1 ref $option{'ignore_fields'} eq 'ARRAY' ? :
3 56 if exists $option{'ignore_fields'}
141 1 1 ref $option{'disable_fields'} eq 'ARRAY' ? :
2 57 if exists $option{'disable_fields'}
146 3 0 ref $option{'invalid_fields'} eq 'ARRAY' ? :
3 56 if exists $option{'invalid_fields'}
149 42 17 if (my $fdat = $option{'fdat'})
154 1 72 if exists $ignore_fields{$key}
155 13 59 ref $val eq 'ARRAY' ? :
163 16 43 if (my $objects = $option{'fobject'})
164 13 3 unless (ref $objects eq 'ARRAY')
169 1 16 unless defined $object->can('param')
175 2 56 if (my $target = $option{'target'})
179 1 57 if (my $invalid_class = $option{'invalid_class'}) { }
185 1 57 if (defined $option{'fill_password'}) { }
194 0 58 unless (exists $$self{'fdat'} or $$self{'objects'})
200 3 55 if (my $file = $option{'file'}) { }
52 3 elsif (my $scalarref = $option{'scalarref'}) { }
2 1 elsif (my $arrayref = $option{'arrayref'}) { }
219 24 267 if ($tagname eq 'form')
221 6 18 if (exists $$attr{'name'} or exists $$attr{'id'}) { }
230 12 4 if (exists $$self{'target'} and !exists($$self{'current_form'}) || $$self{'current_form'} ne $$self{'target'})
238 3 276 if ($$self{'option_no_value'})
244 2 0 if exists $$attr{'name'} and exists $$self{'disable_fields'}{$$attr{'name'}} and $$self{'disable_fields'}{$$attr{'name'}} and not exists $$attr{'disabled'} && $$attr{'disabled'}
252 8 153 if (exists $$attr{'name'} and exists $$self{'invalid_fields'}{$$attr{'name'}} and $$self{'invalid_fields'}{$$attr{'name'}})
256 3 5 if (exists $$attr{'class'} and length $$attr{'class'}) { }
258 2 1 unless ($$attr{'class'} =~ /\b\Q$$self{'invalid_class'}\E\b/)
266 123 156 if ($tagname eq 'input') { }
78 78 elsif ($tagname eq 'option') { }
11 67 elsif ($tagname eq 'textarea') { }
29 38 elsif ($tagname eq 'select') { }
267 121 2 exists $$attr{'name'} ? :
269 1 9 if exists $$attr{'type'} and $$attr{'type'} eq 'hidden' and not exists $$attr{'value'} and not defined $value
272 5 0 if $$self{'clear_absent_checkboxes'} and not defined $value and exists $$attr{'type'} and $$attr{'type'} eq 'checkbox' || $$attr{'type'} eq 'radio'
273 98 25 if (defined $value)
275 43 55 if (not exists $$attr{'type'} or $$attr{'type'} =~ /^(text|textfield|hidden|tel|search|url|email|datetime|date|month|week|time|datetime\-local|number|range|color|)$/i) { }
3 52 elsif (lc $$attr{'type'} eq 'password' and $$self{'fill_password'}) { }
22 30 elsif (lc $$attr{'type'} eq 'radio') { }
29 1 elsif (lc $$attr{'type'} eq 'checkbox') { }
277 7 36 if (ref $value eq 'ARRAY')
279 1 6 unless defined $value
283 2 1 if (ref $value eq 'ARRAY')
285 1 1 unless defined $value
289 4 18 if (ref $value eq 'ARRAY')
291 2 2 unless defined $value
294 2 20 unless exists $$attr{'value'}
295 4 18 if ($$attr{'value'} eq __escapeHTML($value)) { }
302 8 21 unless exists $$attr{'value'}
305 23 6 unless ref $value eq 'ARRAY'
307 10 25 if ($$attr{'value'} eq __escapeHTML($v))
317 9 392 if $key eq '/'
321 9 114 if $$attr{'/'}
328 8 70 if $$self{'clear_absent_checkboxes'} and not defined $value
330 63 15 unless ref $value eq 'ARRAY'
332 54 24 if (defined $$value[0])
333 8 46 if exists $$attr{'selected'}
335 30 24 if (defined $$attr{'value'}) { }
338 27 3 if ($$self{'selectMultiple'}) { }
341 8 28 if ($$attr{'value'} eq __escapeHTML($v))
347 3 0 unless ($$self{'selectSelected'})
348 2 1 if ($$attr{'value'} eq __escapeHTML($$value[0]))
349 2 0 if ref $value eq 'ARRAY'
365 54 24 unless ($$self{'option_no_value'})
372 1 10 if ($invalidating) { }
382 6 5 if ($$attr{'name'} and defined(my $value = $self->_get_param($$attr{'name'})))
383 2 4 if ref $value eq 'ARRAY'
392 20 9 if (defined $$attr{'multiple'}) { }
401 1 28 if ($invalidating) { }
418 6 203 if $$self{'ignore_fields'}{$param}
420 88 115 if exists $$self{'fdat'}{$param}
422 35 80 if exists $$self{'object_param_cache'}{$param}
429 20 21 unless @v
431 5 16 @v > 1 ? :
441 348 2 unless (exists $$self{'outputText'} and $$self{'outputText'} eq 'no')
442 21 327 if (exists $$self{'option_no_value'}) { }
449 6 21 if ($value eq $v)
465 0 138 if ($$self{'option_no_value'})
469 29 109 if ($tagname eq 'select') { }
11 98 elsif ($tagname eq 'textarea') { }
24 74 elsif ($tagname eq 'form') { }
482 0 172 unless defined $toencode
497 0 4 if (index($text, '[if ') == 0 and not $text =~ /