Branch Coverage

blib/lib/HTML/FormFu/Role/Element/Field.pm
Criterion Covered Total %
branch 125 220 56.8


line true false branch
94 0 1012 if @_ > 1
96 1012 0 if (defined $self->name)
101 97 1197 if ($parent->can('is_field') and $parent->is_field) { }
102 97 0 if defined $parent->name
105 155 1042 if defined $parent->nested_name
116 0 18163 if @_ > 1
118 58 18105 unless defined $self->name
122 0 18105 if ($self->form->nested_subscript) { }
139 0 16075 if @_ > 1
141 16075 0 if (defined(my $name = $self->name))
149 535 25625 if ($parent->can('is_field') and $parent->is_field) { }
2888 22737 elsif ($parent->can('is_repeatable') and $parent->is_repeatable) { }
152 451 84 if defined $parent->name
164 2876 19861 if defined $parent->nested_name
169 3205 12870 if (@names)
180 0 67 if @_ > 1
182 0 67 unless defined $self->name
186 0 67 if ($self->form->nested_subscript) { }
203 0 67 if @_ > 1
209 67 0 if (defined(my $name = $self->name))
217 10 169 if ($parent->can('is_field') and $parent->is_field) { }
69 100 elsif ($parent->can('is_repeatable') and $parent->is_repeatable) { }
220 10 0 if (defined $parent->original_name) { }
0 0 elsif (defined $parent->name) { }
236 67 2 if defined $parent->original_nested_name
242 0 100 if ($parent->can('original_nested_name') and defined $parent->original_nested_name) { }
0 100 elsif (defined $parent->nested_name) { }
253 67 0 if (@names)
264 0 0 if @_ > 1
270 0 0 if defined $parent->nested_name
336 6393 1633 unless ($args{'forced'})
390 33 1198 if ($submitted and $self->force_default and defined $default) { }
8 1190 elsif ($submitted and $self->force_default and $self->can('checked') and $self->checked) { }
8 1182 elsif ($submitted and $self->force_default and not defined $default and defined $original) { }
422 39 1226 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 416 786 if ($submitted) { }
463 351 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)
533 6 1211 if (not defined $render->{'label'} and defined $self->auto_label and length $self->auto_label)
539 2 4 defined $self->form->id ? :
6 0 defined $render->{'name'} ? :
548 1 106 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'} ? :
579 3 104 if (defined $render->{'label'} and defined $self->auto_container_label_class and length $self->auto_container_label_class)
584 2 1 defined $self->form->id ? :
592 3 0 defined $render->{'nested_name'} ? :
611 27 80 if (defined $render->{'label'} and defined $render->{'attributes'}{'id'} and not exists $render->{'label_attributes'}{'for'})
624 3 32 if (defined $render->{'comment'} and defined $self->auto_comment_class and length $self->auto_comment_class)
629 2 1 defined $self->form->id ? :
637 3 0 defined $render->{'nested_name'} ? :
651 3 32 if (defined $render->{'comment'} and defined $self->auto_container_comment_class and length $self->auto_container_comment_class)
656 2 1 defined $self->form->id ? :
664 3 0 defined $render->{'nested_name'} ? :
689 409 80 if ($self->form->submitted and defined $name and $self->nested_hash_key_exists($form->input, $name))
693 7 402 if ($self->render_processed_value) { }
703 24 1294 if (ref $input eq 'ARRAY')
706 24 18 if ($self == $elems->[$_])
714 836 482 if (not $self->form->submitted or $self->render_processed_value and defined $value)
723 12 1306 if (ref $value eq 'ARRAY' and defined $self->name)
728 12 0 if (defined $fields->[$i] and $fields->[$i] eq $self)
743 3 1315 if (defined $self->auto_container_class and length $self->auto_container_class)
747 2 1 defined $self->form->id ? :
755 3 0 defined $render->{'nested_name'} ? :
781 1316 2 unless defined $auto_class
786 2 0 defined $self->form->id ? :
2 0 defined $render->{'name'} ? :
2 0 defined $c->type ? :
809 1318 0 unless defined $auto_class
814 0 0 defined $self->form->id ? :
0 0 defined $render->{'name'} ? :
0 0 defined $c->type ? :
837 1318 0 unless defined $auto_class
842 0 0 defined $self->form->id ? :
0 0 defined $render->{'name'} ? :
0 0 defined $c->type ? :
865 1318 0 unless defined $auto_class
870 0 0 defined $self->form->id ? :
0 0 defined $render->{'name'} ? :
0 0 defined $c->type ? :
893 1274 44 unless @errors
904 2 42 if (defined $auto_class and length $auto_class)
906 0 0 defined $self->form->id ? :
907 0 0 defined $render->{'name'} ? :
918 1 43 if (defined $item_class and length $item_class)
921 0 0 defined $self->form->id ? :
922 0 0 defined $render->{'name'} ? :
940 0 44 if ($self->error_container_tag)
945 0 0 if (defined $auto_class and length $auto_class)
947 0 0 defined $self->form->id ? :
948 0 0 defined $render->{'name'} ? :
959 0 0 if (defined $item_class and length $item_class)
962 0 0 defined $self->form->id ? :
963 0 0 defined $render->{'name'} ? :
1006 0 0 if (defined $render->{'container_tag'})
1012 0 0 if (defined $render->{'label'} and $render->{'label_tag'} eq 'legend')
1018 0 0 if (defined $render->{'label'} and $render->{'label_tag'} ne 'legend' and not $render->{'reverse_single'})
1025 0 0 if (defined $render->{'container_tag'})
1050 660 40 unless $render->{'errors'}
1054 0 40 if ($render->{'error_container_tag'})
1072 0 40 if ($render->{'error_container_tag'})
1086 0 0 if (defined $render->{'label'} and $render->{'label_tag'} ne 'legend' and $render->{'reverse_single'})
1093 0 0 if (defined $render->{'comment'})
1100 0 0 if (defined $render->{'container_tag'})
1104 0 0 if (defined $render->{'javascript'})