Branch Coverage

blib/lib/Data/MuForm/Fields.pm
Criterion Covered Total %
branch 139 164 84.7


line true false branch
61 0 515 unless defined $name
62 436 12 if ($self->form and $self == $self->form and exists $self->index->{$name})
66 12 67 if ($name =~ /\./) { }
71 0 30 unless $f
78 65 31 if $field->name eq $name
101 7 901 if $field->name eq $name
111 0 152 unless $self->has_fields
115 2 436 if not $field->is_active or $field->disabled
116 7 31 if $self->skip_fields_without_input and not $field->has_input and not $field->has_input_without_param
119 388 41 if $field->has_value and not $field->no_update
129 1 110 if $self->isa('Data::MuForm') and $self->field_prefix
134 7 289 if not $field->is_active or $field->password or $field->no_fif
136 1 288 if not defined $fif or ref $fif eq 'ARRAY' and not scalar @{$fif;}
137 53 235 if ($field->has_fields) { }
140 0 53 unless $next_params
147 0 111 unless %params
158 0 2 unless $field->is_active
181 3 225 if $field_list->[0] and ref $field_list->[0] ne 'HASH'
185 80 148 unless $self->has_fields
196 4 4 unless (ref $attr eq 'HASH')
216 302 585 unless $count == $num_dots
234 6 451 if ($self->has_include)
238 7 9 if exists $include{$fld->{'name'}}
253 4 583 if ($name =~ /^\+(.*)/)
264 571 15 if $self->form
275 13 574 if ($type =~ s/^\+//)
284 587 8 load_optional_class($try) ? :
587 8 if $class = load_optional_class($try) ? $try : undef
286 0 587 unless $class
298 121 466 if ($field_attr->{'name'} =~ /\./) { }
61 405 elsif (not $self->form && $self == $self->form) { }
306 120 1 if ($parent) { }
307 0 120 unless $parent->isa('Data::MuForm::Field::Compound')
323 181 405 if $parent
336 571 15 if $self->form
338 66 0 if not $self->is_form and $self->is_compound and not exists $field_attr->{'skip_fields_without_input'}
341 7 579 if (defined $index) { }
342 2 5 if ($do_update) { }
344 0 2 unless $field
348 4 8 if $key eq 'name' or $key eq 'form' or $key eq 'parent' or $key eq 'full_name' or $key eq 'type'
350 8 0 if $field->can($key)
363 35 551 if $field->form and $field->is_repeatable
382 71 554 if ($field->has_fields)
387 566 59 unless $field->order
396 2 1 if $field->order > $order
420 0 0 unless defined $input or $exists or $self->has_fields
425 160 0 if (ref $input eq 'HASH')
427 0 454 unless $field->is_active
430 7 31 if $self->skip_fields_without_input and not $exists and not $field->has_input_without_param
431 1 446 if (not $exists and $field->disabled and not $field->has_value) { }
437 390 57 if $field->has_input
442 158 2 scalar keys %$my_input ? :
449 0 95 unless $obj or $self->has_fields
453 6 77 if ($self->form and $self->form->fill_from_object_source and $self->form->fill_from_object_source eq 'model' and $self->form->has_init_values)
460 0 257 unless $field->is_active
461 35 222 if (ref $obj eq 'HASH' and not exists $$obj{$field->accessor} or &blessed($obj) and not $obj->can($field->accessor)) { }
465 9 26 if ($init_obj)
470 7 2 if (defined $init_obj_value)
476 28 7 unless $found
479 222 0 unless $field->writeonly
496 6 232 if (my(@values) = $self->get_default_value)
497 0 6 @values > 1 ? :
498 6 0 if (ref $value eq 'HASH' or &blessed($value))
501 0 0 if (defined $value)
508 0 642 unless $field->is_active
510 65 577 if $field->has_value
515 43 189 if keys %$my_value
524 0 10 if (scalar @$field_name_array)
537 11 221 if (&blessed($obj) and $obj->can($accessor)) { }
216 5 elsif (exists $obj->{$accessor}) { }
3 2 elsif (@values = $field->get_default_value) { }
541 1 10 if (scalar @values == 1 and ref $values[0] eq 'ARRAY' and $field->multiple)
547 2 214 if ($field->multiple and ref $v eq 'ARRAY') { }
558 8 222 if ($field->has_transform_default_to_value)
562 5 225 if ($field->multiple) { }
563 1 4 if (scalar @values == 1 and not defined $values[0]) { }
1 3 elsif (scalar @values == 1 and ref $values[0] eq 'ARRAY') { }
574 0 225 @values > 1 ? :
584 3 302 unless $field->is_active
585 267 35 if $field->has_value and not $field->no_update
597 62 71 unless $self->is_form
612 16 65 if ($self->parent)