Branch Coverage

blib/lib/Rose/HTML/Form/Field.pm
Criterion Covered Total %
branch 178 238 74.7


line true false branch
69 2 59 if (@_)
77 5 1 length $label ? :
6 53 defined $label ? :
84 128 0 if (@_)
92 0 0 length $label ? :
0 0 defined $label ? :
101 0 3182 if (@_)
103 0 0 $_[0] ? :
108 3108 74 defined $self->{'auto_invalidate_parent'} ? :
127 249 5078 if (@_)
129 249 0 if (ref $_[0]) { }
147 317 32989 if (@_)
149 317 0 if (ref $_[0]) { }
167 329 39768 if (@_)
169 329 0 if (ref $_[0]) { }
189 0 0 unless $parent
219 9222 6217 unless my $parent_form = $self->parent_form
226 9138 6301 unless my $parent_field = $self->parent_field
227 0 6301 unless my $name = $parent_field->fq_name
243 167 0 if (@_) { }
258 3355 0 if $self->parent_field or $self->parent_form
266 1546 13465 if (@_)
271 0 1546 if (index($name, ".") >= 0 and not $self->isa("Rose::HTML::Form::Field::Hidden"))
279 3 1543 if (defined $old_name and $name ne $old_name)
281 1 2 if (my $parent_form = $self->parent_form)
287 0 3 if (my $parent_field = $self->parent_field)
298 13013 452 if defined $name
306 559 7780 if (@_)
317 2702 5078 unless (length $name)
329 257 501 if (@_) { }
335 444 57 if defined $self->{'moniker'}
344 554 4275 if (@_)
363 2921 3021 if (@_)
371 1211 1710 if (my $parent = $self->parent_field)
373 172 1039 if not $parent->{'in_init'} and $parent->_is_full
375 54 1157 if ($self->auto_invalidate_parent)
384 69 2952 if $self->is_cleared or $self->has_partial_value
387 872 2080 defined $self->{'input_value'} ? :
390 0 2952 if (wantarray and ref $value eq "ARRAY")
410 205 1109 if ($self->is_full(@_))
427 4 74 if (my $input_filter = $self->input_filter)
440 0 7302 if @_
442 3982 3320 if $self->is_cleared or $self->has_partial_value
444 1276 2044 if (defined $self->{'internal_value'})
446 2 1274 if (wantarray and ref $self->{'internal_value'} eq "ARRAY")
458 1361 683 unless (defined $value)
466 29 2015 if (my $input_filter = $self->input_filter) { }
475 683 1361 unless $using_default
477 2 2042 if (wantarray and ref $final_value eq "ARRAY")
491 0 548 if @_
493 56 492 if $self->is_cleared
495 172 320 if defined $self->{'output_value'}
499 22 298 if (my $output_filter = $self->output_filter) { }
506 0 320 if (wantarray and ref $self->{'output_value'} eq "ARRAY")
521 303 3304 $value =~ /\S/ || !$self->trim_spaces && length $value ? :
530 1385 737 unless defined $value
532 700 37 unless (ref $value)
538 698 2 if ($self->trim_spaces)
553 11 2122 if (@_)
567 14 321 if (@_)
580 1 0 if (@_)
589 1 0 if (ref $input_filter and $input_filter eq $self->output_filter)
625 0 115 unless (@{$hidden_field_class . "::ISA";})
636 0 0 if $error
661 0 12 wantarray ? :
677 0 7 wantarray ? :
685 0 0 if @_
693 2 938 if ($self->html_element and $self->apply_error_class and defined $self->error) { }
713 2 448 if ($self->html_element and $self->apply_error_class and defined $self->error) { }
741 5 45 if ($error)
758 4 28 if ($error)
776 396 10 $self->escape_html ? :
779 26 380 if ($self->html_attr_exists("id"))
785 10 396 $self->required ? :
788 7 399 defined $self->error ? :
792 0 406 if (@_)
809 8 392 unless length $self->label
817 14 11 unless length $self->label
829 2 34 if ($self->required and !ref($value) && (!defined($value) || $self->trim_spaces && !($value =~ /\S/)) || ref $value eq 'ARRAY' && !@$value)
833 21 0 unless ($self->is_empty and $self->empty_is_ok)
837 7 14 if (defined $label) { }
852 2 191 if $self->validator
861 0 2 unless my $code = $self->validator
867 1 0 unless ($ok or $self->has_errors)
871 0 1 if (defined $label) { }
888 2 212 if (@_)
892 2 0 if (ref $code eq 'CODE') { }
916 25 65 if ($error_id == 3) { }
1 64 elsif ($error_id == 9) { }
920 6 19 if (ref $args eq 'HASH' and keys %$args or ref $args eq 'ARRAY' and @$args) { }
935 0 1 if (ref $args eq 'HASH' and keys %$args or ref $args eq 'ARRAY' and @$args) { }
960 5322 144 if (my $class = ref $invocant) { }
962 0 5322 if (@_)
966 0 0 if (ref $invocant->{'localizer'} eq 'CODE') { }
978 5322 0 unless ($localizer)
980 21 5301 if (my $parent_field = $invocant->parent_field) { }
183 5118 elsif (my $parent_form = $invocant->parent_form) { }
982 21 0 if (my $localizer = $parent_field->localizer)
984 0 21 ref $localizer eq 'CODE' ? :
989 183 0 if (my $localizer = $parent_form->localizer)
991 0 183 ref $localizer eq 'CODE' ? :
997 0 0 if (ref $localizer eq "CODE")
1006 1 143 if (@_)
1022 4085 0 if (my $class = ref $invocant) { }
1024 20 4065 if (@_)
1028 0 20 if (ref $invocant->{'locale'} eq 'CODE') { }
1040 48 4017 if ($locale)
1042 0 48 ref $locale eq 'CODE' ? :
1045 17 4000 if (my $parent_field = $invocant->parent_field) { }
308 3692 elsif (my $parent_form = $invocant->parent_form) { }
1606 2086 elsif ($invocant->can('parent_group') and my $parent_group = $invocant->parent_group) { }
1047 17 0 if (my $locale = $parent_field->locale)
1049 0 17 ref $locale eq 'CODE' ? :
1054 308 0 if (my $locale = $parent_form->locale)
1056 0 308 ref $locale eq 'CODE' ? :
1061 1606 0 if (my $locale = $parent_group->locale)
1063 0 1606 ref $locale eq 'CODE' ? :
1070 0 2086 if (ref $locale eq "CODE")
1080 0 0 if (@_)