Branch Coverage

blib/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm
Criterion Covered Total %
branch 149 184 80.9


line true false branch
18 5 57 if (defined $attrs and ref $attrs eq 'HASH') { }
1 112 elsif (defined $attrs and ref $attrs eq 'ARRAY') { }
60 0 215 unless defined $updates
63 0 215 unless ref $updates eq 'HASH'
66 0 215 if defined $fixed_fields and ref $fixed_fields ne 'ARRAY'
70 85 130 if defined $object
77 85 130 if $source->storage->debug
80 0 215 if (&blessed($updates) and $updates->isa('DBIx::Class::Row'))
87 138 138 if (exists $updates->{$colname} and defined $updates->{$colname})
92 58 80 if exists $resolved->{$colname} and defined $resolved->{$colname}
107 78 137 if (scalar keys %pk_kvs != scalar @pks and @non_pk_columns)
126 12 12 if ($accessor_name ne $colname and exists $non_rel_updates{$accessor_name})
142 4 77 if exists $pk_kvs{$colname}
144 6 71 if ($row->can($colname) and defined $row->$colname) { }
164 80 135 if (not defined $object and scalar keys %pk_kvs == scalar @pks)
166 4 76 if (defined $cached_rows)
179 76 139 if (not defined $object and scalar keys %all_pks == scalar @pks)
184 62 153 unless (defined $object)
209 355 141 if (exists $columns_by_accessor{$name} and not $source->has_relationship($name) && ref $updates->{$name})
216 112 29 if ($source->has_relationship($name))
217 63 49 if (_master_relation_cond($self, $name)) { }
228 24 5 if (is_m2m($self, $name))
235 17 7 if (not $m2m_force_set_rel and $source->result_class->can('_m2m_metadata')) { }
258 2 3 if ($object->can($name) and not $source->has_relationship($name))
268 2 1 unless $unknown_params_ok
300 130 75 if $object->is_changed or keys %other_methods
316 7 0 if (defined $value and ref $value eq 'ARRAY') { }
0 0 elsif (defined $value and not ref $value) { }
0 0 elsif (defined $value) { }
326 0 16 if (&blessed($elem) and $elem->isa('DBIx::Class::Row')) { }
5 11 elsif (ref $elem eq 'HASH') { }
367 0 67 unless defined $rows
369 0 67 unless ref $kvs eq 'HASH'
372 0 67 if keys %$kvs == 0
375 0 67 unless ref $rows eq 'ARRAY'
378 0 67 unless ($rows)
389 37 97 if &all(sub { $kvs->{$_} eq $row->get_column($_); } , grep({not ref $kvs->{$_};} sort(keys %$kvs)))
392 0 67 if @matching_rows > 1
394 37 30 if scalar @matching_rows == 1
397 37 30 if defined $matching_row
400 30 37 unless defined $matching_row
412 0 118 unless $object->has_relationship($name)
423 0 118 unless $self->result_source->can('_resolve_condition')
427 41 77 if defined $DBIx::Class::ResultSource::UNRESOLVABLE_CONDITION and $DBIx::Class::ResultSource::UNRESOLVABLE_CONDITION == $resolved
434 0 118 if (ref $info->{'cond'} eq 'CODE') { }
453 113 5 unless $related_resultset->result_source->column_info($rel_col)->{'is_nullable'}
456 3 113 $all_fks_nullable ? :
116 2 unless defined $if_not_submitted
460 49 69 if ($attrs->{'accessor'} eq 'multi') { }
69 0 elsif ($attrs->{'accessor'} eq 'single' or $attrs->{'accessor'} eq 'filter') { }
464 1 48 unless defined $updates
466 0 49 unless ref $updates eq 'ARRAY'
472 28 21 if ($row_existed)
488 66 76 if (exists $sub_updates->{$colname} and defined $sub_updates->{$colname})
492 29 37 if (ref $sub_updates->{$colname} eq 'HASH') { }
493 29 0 if ($related_source->has_relationship($colname)) { }
498 0 29 if scalar @rel_cols != 1
521 52 24 if exists $resolved->{$colname} and defined $resolved->{$colname}
538 23 62 if (scalar keys %pk_kvs != scalar @pks and @non_pk_columns)
557 10 10 if ($accessor_name ne $colname and exists $non_rel_updates{$accessor_name})
574 3 24 if exists $pk_kvs{$colname}
576 2 22 if ($related_row->can($colname) and defined $related_row->$colname) { }
609 63 22 if (scalar keys %pk_kvs == scalar @pks)
631 2 61 if not defined $related_object and &any(sub { $resolved->{$_} ne $current_data{$_}; } , keys %$resolved)
639 50 2 unless (defined $related_object or $relink)
663 17 27 if (scalar @remove_rows)
667 6 11 if (scalar @pks == 1) { }
691 8 3 if (scalar @cond)
696 15 2 if ($if_not_submitted eq 'delete') { }
2 0 elsif ($if_not_submitted eq 'set_to_null') { }
711 68 1 if (ref $updates) { }
714 24 44 if exists $updates->{$_}
24 44 if (&all(sub { defined $updates->{$_} if exists $updates->{$_}; } , @pks))
720 2 66 if ($row_existed)
724 10 58 if (&blessed($updates) and $updates->isa('DBIx::Class::Row')) { }
1 57 elsif ($attrs->{'accessor'} eq 'single' and defined $related_row) { }
729 0 1 $existing_row ? :
736 24 33 $existing_row ? :
748 0 1 unless not $updates and (exists $attrs->{'join_type'} and $attrs->{'join_type'} eq 'LEFT')
759 65 0 if ($sub_object || $updates || $might_belong_to || $join_type eq 'LEFT' and ref $info->{'cond'} ne 'CODE')
778 56 279 if ($rclass->can('_m2m_metadata'))
782 10 263 if ($object->can($relation) and not $self->result_source->has_relationship($relation) and $object->can('set_' . $relation))
795 2 5 if ($rclass->can('_m2m_metadata'))
808 0 0 if ($object->result_source->column_info($col)->{'is_auto_increment'} and !defined($object->{'_column_data'}{$col}) || $object->{'_column_data'}{$col} eq '')
821 73 7 if ($self->result_source->has_relationship($relation))
826 7 73 if (is_m2m($self, $relation))
845 39 73 if $info->{'attrs'}{'accessor'} eq 'multi'
859 9 63 if ($source->column_info($col)->{'is_auto_increment'})
862 63 0 if (&any(sub { $_ eq $f_key; } , @foreign_ids))
869 73 0 if (ref $cond eq 'HASH') { }
0 0 elsif (ref $cond eq 'ARRAY') { }
0 0 elsif (ref $cond eq 'CODE') { }