Branch Coverage

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


line true false branch
25 374 18 if (ref $field_list eq 'HASH') { }
18 0 elsif (ref $field_list eq 'ARRAY') { }
26 1 373 if scalar keys %{$field_list;}
29 18 0 if scalar @{$field_list;}
48 252 143 if $meta_flist
50 19 373 if ($flist)
51 4 15 if (ref $flist eq 'ARRAY' and ref $flist->[0] eq 'HASH') { }
58 0 392 if $self->fields_from_model
59 0 392 if $mlist
61 130 262 unless $self->has_fields
76 1694 0 if ($meta->can('calculate_all_roles'))
78 11 4422 if ($role->can('field_list') and $role->has_field_list)
85 255 1439 if ($meta->can('field_list') and $meta->has_field_list)
91 252 143 if scalar @$field_list
97 14 1 if (ref $flist eq 'ARRAY')
111 14 29 unless (ref $attr eq 'HASH')
134 531 1081 unless $count == $num_dots
144 3 267 if ($self->has_include)
148 7 9 if exists $include{$fld->{'name'}}
165 4 1077 if ($name =~ /^\+(.*)/)
174 1076 4 unless $do_update
178 1057 21 if $self->form
201 15 1066 if ($type =~ s/^\+//)
212 1080 19 load_optional_class($try) ? :
1080 19 if $class = load_optional_class($try) ? $try : undef
214 1 1080 unless $class
225 210 870 if ($field_attr->{'name'} =~ /\./) { }
72 798 elsif (not $self->form && $self == $self->form) { }
233 210 0 if ($parent) { }
234 0 210 unless $parent->isa('HTML::FormHandler::Field::Compound')
250 282 798 if $parent
261 1091 21 if $self->form
269 1091 21 if ($self->form)
271 147 944 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 1089 if ($self->form->has_widget_tags)
288 79 1033 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 1042 if keys %$all_updates
320 27 1085 if keys %$single_updates
323 1112 0 unless ($self->form and $self->form->no_widgets)
326 1066 46 unless ($widget)
328 1066 0 if $attr
330 1 1111 if $widget eq 'None'
333 1086 26 unless ($widget_wrapper)
335 0 1086 if $attr
336 1065 21 if $self->form
341 1101 11 if ($widget)
345 1110 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 1057 21 if $self->form
383 14 1064 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 1029 if $field->form and $field->has_flag('is_repeatable')
416 1110 0 if (@$traits)
438 1 856 if $field->order > $order
443 856 1 unless $field->order