Branch Coverage

blib/lib/HTML/FormFu/Role/Element/Field.pm
Criterion Covered Total %
branch 127 226 56.1


line true false branch
94 0 1011 if @_ > 1
96 1011 0 if (defined $self->name)
101 97 1196 if ($parent->can('is_field') and $parent->is_field) { }
102 97 0 if defined $parent->name
105 158 1038 if defined $parent->nested_name
116 0 17719 if @_ > 1
118 58 17661 unless defined $self->name
122 0 17661 if ($self->form->nested_subscript) { }
139 0 15631 if @_ > 1
141 15631 0 if (defined(my $name = $self->name))
149 535 25245 if ($parent->can('is_field') and $parent->is_field) { }
2914 22331 elsif ($parent->can('is_repeatable') and $parent->is_repeatable) { }
152 451 84 if defined $parent->name
164 2914 19417 if defined $parent->nested_name
169 3243 12388 if (@names)
180 0 71 if @_ > 1
182 0 71 unless defined $self->name
186 0 71 if ($self->form->nested_subscript) { }
203 0 71 if @_ > 1
209 71 0 if (defined(my $name = $self->name))
217 10 177 if ($parent->can('is_field') and $parent->is_field) { }
73 104 elsif ($parent->can('is_repeatable') and $parent->is_repeatable) { }
220 10 0 if (defined $parent->original_name) { }
0 0 elsif (defined $parent->name) { }
236 71 2 if defined $parent->original_nested_name
242 0 104 if ($parent->can('original_nested_name') and defined $parent->original_nested_name) { }
0 104 elsif (defined $parent->nested_name) { }
253 71 0 if (@names)
264 0 0 if @_ > 1
270 0 0 if defined $parent->nested_name
336 6262 1640 unless ($args{'forced'})
390 33 1173 if ($submitted and $self->force_default and defined $default) { }
8 1165 elsif ($submitted and $self->force_default and $self->can('checked') and $self->checked) { }
8 1157 elsif ($submitted and $self->force_default and not defined $default and defined $original) { }
422 39 1233 if (not defined $render->{'attributes'}{'id'} and defined $self->auto_id and length $self->auto_id)
426 31 8 defined $self->form->id ? :
434 39 0 defined $render->{'nested_name'} ? :
444 4 35 if (defined(my $count = $self->repeatable_count))
462 423 786 if ($submitted) { }
463 358 65 if (defined $value) { }
37 28 elsif (defined $default) { }
474 12 0 if ($submitted and $self->retain_default and defined $new and $new eq $HTML::FormFu::Role::Element::Field::EMPTY_STR)
484 2 25 if ($submitted and $self->force_default and defined $default and $new ne $default)
534 6 1216 if (not defined $render->{'label'} and defined $self->auto_label and length $self->auto_label)
540 2 4 defined $self->form->id ? :
6 0 defined $render->{'name'} ? :
549 1 108 if (defined $render->{'label'} and defined $self->auto_label_class and length $self->auto_label_class)
553 0 1 defined $self->form->id ? :
561 1 0 defined $render->{'nested_name'} ? :
578 3 106 if (defined $render->{'label'} and defined $self->auto_container_label_class and length $self->auto_container_label_class)
582 2 1 defined $self->form->id ? :
590 3 0 defined $render->{'nested_name'} ? :
609 27 82 if (defined $render->{'label'} and defined $render->{'attributes'}{'id'} and not exists $render->{'label_attributes'}{'for'})
622 3 32 if (defined $render->{'comment'} and defined $self->auto_comment_class and length $self->auto_comment_class)
626 2 1 defined $self->form->id ? :
634 3 0 defined $render->{'nested_name'} ? :
647 3 32 if (defined $render->{'comment'} and defined $self->auto_container_comment_class and length $self->auto_container_comment_class)
651 2 1 defined $self->form->id ? :
659 3 0 defined $render->{'nested_name'} ? :
684 416 80 if ($self->form->submitted and defined $name and $self->nested_hash_key_exists($form->input, $name))
688 7 409 if ($self->render_processed_value) { }
698 24 1301 if (ref $input eq 'ARRAY')
701 24 18 if ($self == $elems->[$_])
709 836 489 if (not $self->form->submitted or $self->render_processed_value and defined $value)
718 12 1313 if (ref $value eq 'ARRAY' and defined $self->name)
723 12 0 if (defined $fields->[$i] and $fields->[$i] eq $self)
738 3 1322 if (defined $self->auto_container_class and length $self->auto_container_class)
741 2 1 defined $self->form->id ? :
749 3 0 defined $render->{'nested_name'} ? :
775 1323 2 unless defined $auto_class
780 2 0 defined $self->form->id ? :
2 0 defined $render->{'name'} ? :
2 0 defined $c->type ? :
803 1325 0 unless defined $auto_class
808 0 0 defined $self->form->id ? :
0 0 defined $render->{'name'} ? :
0 0 defined $c->type ? :
831 1325 0 unless defined $auto_class
836 0 0 defined $self->form->id ? :
0 0 defined $render->{'name'} ? :
0 0 defined $c->type ? :
859 1325 0 unless defined $auto_class
864 0 0 defined $self->form->id ? :
0 0 defined $render->{'name'} ? :
0 0 defined $c->type ? :
887 1274 51 unless @errors
896 1 50 if (defined $field_class and length $field_class)
898 0 0 defined $self->form->id ? :
899 0 0 defined $render->{'name'} ? :
912 2 49 if (defined $auto_class and length $auto_class)
914 0 0 defined $self->form->id ? :
915 0 0 defined $render->{'name'} ? :
926 1 50 if (defined $item_class and length $item_class)
929 0 0 defined $self->form->id ? :
930 0 0 defined $render->{'name'} ? :
947 0 51 if ($self->error_container_tag)
952 0 0 if (defined $auto_class and length $auto_class)
954 0 0 defined $self->form->id ? :
955 0 0 defined $render->{'name'} ? :
966 0 0 if (defined $item_class and length $item_class)
969 0 0 defined $self->form->id ? :
970 0 0 defined $render->{'name'} ? :
1014 0 0 if (defined $render->{'container_tag'})
1020 0 0 if (defined $render->{'label'} and $render->{'label_tag'} eq 'legend')
1026 0 0 if (defined $render->{'label'} and $render->{'label_tag'} ne 'legend' and not $render->{'reverse_single'})
1033 0 0 if (defined $render->{'container_tag'})
1058 660 47 unless $render->{'errors'}
1062 0 47 if ($render->{'error_container_tag'})
1080 0 47 if ($render->{'error_container_tag'})
1094 0 0 if (defined $render->{'label'} and $render->{'label_tag'} ne 'legend' and $render->{'reverse_single'})
1101 0 0 if (defined $render->{'comment'})
1108 0 0 if (defined $render->{'container_tag'})
1112 0 0 if (defined $render->{'javascript'})