Branch Coverage

blib/lib/HTML/FormHandler/BuildFields.pm
Criterion Covered Total %
branch 119 136 87.5


line true false branch
25 376 18 if (ref $field_list eq 'HASH') { }
18 0 elsif (ref $field_list eq 'ARRAY') { }
26 1 375 if scalar keys %{$field_list;}
29 18 0 if scalar @{$field_list;}
48 254 143 if $meta_flist
50 19 375 if ($flist)
51 4 15 if (ref $flist eq 'ARRAY' and ref $flist->[0] eq 'HASH') { }
58 0 394 if $self->fields_from_model
59 0 394 if $mlist
61 130 264 unless $self->has_fields
76 1702 0 if ($meta->can('calculate_all_roles'))
78 11 4445 if ($role->can('field_list') and $role->has_field_list)
85 257 1445 if ($meta->can('field_list') and $meta->has_field_list)
91 254 143 if scalar @$field_list
97 14 1 if (ref $flist eq 'ARRAY')
111 14 29 unless (ref $attr eq 'HASH')
134 531 1087 unless $count == $num_dots
144 3 269 if ($self->has_include)
148 7 9 if exists $include{$fld->{'name'}}
165 4 1083 if ($name =~ /^\+(.*)/)
174 1082 4 unless $do_update
178 1063 21 if $self->form
201 15 1072 if ($type =~ s/^\+//)
212 1086 19 load_optional_class($try) ? :
1086 19 if $class = load_optional_class($try) ? $try : undef
214 1 1086 unless $class
225 210 876 if ($field_attr->{'name'} =~ /\./) { }
72 804 elsif (not $self->form && $self == $self->form) { }
233 210 0 if ($parent) { }
234 0 210 unless $parent->isa('HTML::FormHandler::Field::Compound')
250 282 804 if $parent
261 1097 21 if $self->form
269 1097 21 if ($self->form)
271 147 950 if (keys %$field_updates)
274 78 69 if (exists $field_updates->{'by_flag'})
277 2 145 if (exists $field_updates->{'by_type'} and exists $field_updates->{'by_type'}{$field_attr->{'type'}})
283 2 1095 if ($self->form->has_widget_tags)
288 79 1039 if ($self->has_flag('is_compound'))
293 3 76 if (keys %$comp_field_updates)
297 0 3 if (exists $field_updates->{'by_flag'})
300 0 3 if (exists $comp_field_updates->{'by_type'} and exists $comp_field_updates->{'by_type'}{$field_attr->{'type'}})
305 0 79 if ($self->has_widget_tags)
310 3 76 if keys %$comp_all_updates
313 1 78 if keys %$comp_single_updates
319 70 1048 if keys %$all_updates
320 27 1091 if keys %$single_updates
323 1118 0 unless ($self->form and $self->form->no_widgets)
326 1072 46 unless ($widget)
328 1072 0 if $attr
330 1 1117 if $widget eq 'None'
333 1092 26 unless ($widget_wrapper)
335 0 1092 if $attr
336 1071 21 if $self->form
341 1107 11 if ($widget)
345 1116 0 if ($widget_wrapper)
357 1 77 if (exists $by_flag->{'contains'} and $field_attr->{'is_contains'}) { }
5 72 elsif (exists $by_flag->{'repeatable'} and $class->meta->find_attribute_by_name('is_repeatable')) { }
3 89 elsif (exists $by_flag->{'compound'} and $class->meta->find_attribute_by_name('is_compound')) { }
380 1063 21 if $self->form
383 14 1070 if (defined $index) { }
384 4 10 if ($do_update) { }
387 0 4 unless $field
390 8 4 if $key eq 'name' or $key eq 'form' or $key eq 'parent' or $key eq 'full_name' or $key eq 'type'
392 4 0 if $field->can($key)
407 49 1035 if $field->form and $field->has_flag('is_repeatable')
416 1116 0 if (@$traits)
438 1 862 if $field->order > $order
443 862 1 unless $field->order