Branch Coverage

blib/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm
Criterion Covered Total %
branch 158 198 79.8


line true false branch
18 7 68 if (defined $attrs and ref $attrs eq 'HASH') { }
1 134 elsif (defined $attrs and ref $attrs eq 'ARRAY') { }
62 0 0 unless my $sub = (caller $i++)[3]
63 0 0 if $sub =~ /(?:recursive_update|_update_relation)$/
70 0 277 unless defined $updates
73 0 277 unless ref $updates eq 'HASH'
76 0 277 if defined $fixed_fields and ref $fixed_fields ne 'ARRAY'
80 116 161 if defined $object
87 147 130 if $source->storage->debug
90 0 277 if (&blessed($updates) and $updates->isa('DBIx::Class::Row'))
97 177 192 if (exists $updates->{$colname} and defined $updates->{$colname})
102 89 103 if exists $resolved->{$colname} and defined $resolved->{$colname}
117 101 176 if (scalar keys %pk_kvs != scalar @pks and @non_pk_columns)
136 12 12 if ($accessor_name ne $colname and exists $non_rel_updates{$accessor_name})
152 22 100 if exists $pk_kvs{$colname}
154 6 94 if ($row->can($colname) and defined $row->$colname) { }
174 106 171 if (not defined $object and scalar keys %pk_kvs == scalar @pks)
176 4 102 if (defined $cached_rows)
189 102 175 if (not defined $object and scalar keys %all_pks == scalar @pks)
194 67 210 unless (defined $object)
219 443 172 if (exists $columns_by_accessor{$name} and not $source->has_relationship($name) && ref $updates->{$name})
226 130 42 if ($source->has_relationship($name))
227 82 48 if (_master_relation_cond($self, $name)) { }
238 37 5 if (is_m2m($self, $name))
245 27 10 if (not $m2m_force_set_rel and $source->result_class->can('_m2m_metadata')) { }
268 2 3 if ($object->can($name) and not $source->has_relationship($name))
278 2 1 unless $unknown_params_ok
310 152 115 if $object->is_changed or keys %other_methods
326 10 0 if (defined $value and ref $value eq 'ARRAY') { }
0 0 elsif (defined $value and not ref $value) { }
0 0 elsif (defined $value) { }
336 0 23 if (&blessed($elem) and $elem->isa('DBIx::Class::Row')) { }
5 18 elsif (ref $elem eq 'HASH') { }
376 0 100 unless defined $rows
378 0 100 unless ref $kvs eq 'HASH'
381 0 100 if keys %$kvs == 0
384 0 100 unless ref $rows eq 'ARRAY'
387 0 100 unless ($rows)
399 62 177 if &all(sub {
402 0 100 if @matching_rows > 1
404 62 38 if scalar @matching_rows == 1
407 62 38 if defined $matching_row
410 38 62 unless defined $matching_row
422 0 146 unless $object->has_relationship($name)
433 0 146 unless $self->result_source->can('_resolve_condition')
437 46 100 if defined $DBIx::Class::ResultSource::UNRESOLVABLE_CONDITION and $DBIx::Class::ResultSource::UNRESOLVABLE_CONDITION == $resolved
444 0 146 if (ref $info->{'cond'} eq 'CODE') { }
463 141 5 unless $related_resultset->result_source->column_info($rel_col)->{'is_nullable'}
466 3 141 $all_fks_nullable ? :
144 2 unless defined $if_not_submitted
470 59 87 if ($attrs->{'accessor'} eq 'multi') { }
87 0 elsif ($attrs->{'accessor'} eq 'single' or $attrs->{'accessor'} eq 'filter') { }
474 1 58 unless defined $updates
476 0 59 unless ref $updates eq 'ARRAY'
482 38 21 if ($row_existed)
498 69 135 if (exists $sub_updates->{$colname} and defined $sub_updates->{$colname})
502 29 40 if (ref $sub_updates->{$colname} eq 'HASH') { }
503 29 0 if ($related_source->has_relationship($colname)) { }
508 0 29 if scalar @rel_cols != 1
531 83 52 if exists $resolved->{$colname} and defined $resolved->{$colname}
555 51 65 if (scalar keys %pk_kvs != scalar @pks and @non_pk_columns)
567 3 31 unless $rel_info->{'attrs'}{'accessor'} eq 'single' and $rel_info->{'attrs'}{'is_foreign_key_constraint'}
575 1 30 unless &any(sub {
580 10 20 if (keys %{$$rel_info{'cond'};} == 1 and not ref $sub_updates->{$relname}) { }
20 0 elsif (ref $sub_updates->{$relname} eq 'HASH') { }
600 21 95 if (scalar keys %pk_kvs != scalar @pks and @non_pk_columns)
619 10 10 if ($accessor_name ne $colname and exists $non_rel_updates{$accessor_name})
636 1 22 if exists $pk_kvs{$colname}
638 2 20 if ($related_row->can($colname) and defined $related_row->$colname) { }
671 96 20 if (scalar keys %pk_kvs == scalar @pks)
693 2 94 if not defined $related_object and &any(sub {
701 56 2 unless (defined $related_object or $relink)
725 21 33 if (scalar @remove_rows)
729 6 15 if (scalar @pks == 1) { }
753 11 4 if (scalar @cond)
758 19 2 if ($if_not_submitted eq 'delete') { }
2 0 elsif ($if_not_submitted eq 'set_to_null') { }
773 86 1 if (ref $updates) { }
776 37 49 if exists $updates->{$_}
37 49 if (&all(sub {
782 2 84 if ($row_existed)
786 10 76 if (&blessed($updates) and $updates->isa('DBIx::Class::Row')) { }
1 75 elsif ($attrs->{'accessor'} eq 'single' and defined $related_row) { }
791 0 1 $existing_row ? :
798 37 38 $existing_row ? :
810 0 1 unless not $updates and (exists $attrs->{'join_type'} and $attrs->{'join_type'} eq 'LEFT')
821 83 0 if ($sub_object || $updates || $might_belong_to || $join_type eq 'LEFT' and ref $info->{'cond'} ne 'CODE')
840 70 322 if ($rclass->can('_m2m_metadata'))
844 12 304 if ($object->can($relation) and not $self->result_source->has_relationship($relation) and $object->can('set_' . $relation))
857 4 6 if ($rclass->can('_m2m_metadata'))
870 0 0 if ($object->result_source->column_info($col)->{'is_auto_increment'} and !defined($object->{'_column_data'}{$col}) || $object->{'_column_data'}{$col} eq '')
883 93 10 if ($self->result_source->has_relationship($relation))
888 10 93 if (is_m2m($self, $relation))
907 39 93 if $info->{'attrs'}{'accessor'} eq 'multi'
921 9 84 if ($source->column_info($col)->{'is_auto_increment'})
924 84 0 if (&any(sub {
931 93 0 if (ref $cond eq 'HASH') { }
0 0 elsif (ref $cond eq 'ARRAY') { }
0 0 elsif (ref $cond eq 'CODE') { }