Branch Coverage

blib/lib/Data/Model.pm
Criterion Covered Total %
branch 133 160 83.1


line true false branch
52 0 1818 unless $schema
71 4 3 unless $self->get_driver($model)
84 5 4 if ($old)
88 6 3 if ($driver)
104 0 83 if $target and $model ne $target
115 28 640 unless exists $_[0]
120 254 386 if (ref $_[0] eq 'HASH') { }
64 322 elsif (ref $_[0] eq 'ARRAY') { }
322 0 elsif (not ref $_[0]) { }
134 254 386 if ($query) { }
20 366 elsif (ref $_[0] eq 'HASH') { }
145 272 368 if ($RUN_VALIDATION and $query)
154 0 114 unless $_[0]
155 2 112 unless scalar @{[%{$_[0];}];} == 2
187 12 374 if $key_array and ref $key_array and not defined $$key_array[0]
190 132 500 if ($schema->has_deflate)
191 104 28 if ($key_array)
198 20 112 if ($query and ref $$query{'index'} eq 'HASH')
200 4 16 unless ref $key_array eq 'ARRAY'
207 12 620 if $key_array and not @{$key_array;}
208 0 620 unless $key_array or $query
214 2 182 if $$self{'active_transaction'}
216 0 182 unless $schema
218 166 16 unless ref $id eq 'ARRAY'
226 4 178 unless scalar @{$id;} == scalar @{$schema->key;}
229 16 162 unless $data
232 162 0 unless ($$schema{'options'}{'bare_row'})
242 2 60 if $$self{'active_transaction'}
244 0 60 unless $schema
246 4 56 unless ref $ids eq 'ARRAY'
250 116 24 unless ref $id eq 'ARRAY'
253 8 132 unless scalar @{$id;} == $id_size
264 1 51 unless $results and ref $results eq 'HASH'
268 104 8 unless ($$schema{'options'}{'bare_row'} or not $obj)
286 2 581 if $$self{'active_transaction'}
289 0 581 unless $schema
292 12 561 if @_ and not @{$query;}
295 93 468 unless ($iterator)
296 40 53 if wantarray
300 290 178 if (wantarray)
304 324 2 unless ($$schema{'options'}{'bare_row'})
311 174 116 if exists $$iterator_options{'end'} and ref $$iterator_options{'end'} eq 'CODE'
318 0 446 if $$schema{'options'}{'bare_row'}
329 2 0 if $$self{'active_transaction'}
339 2 525 if $_[0]{'active_transaction'}
344 2 16 if $_[0]{'active_transaction'}
352 12 529 if ref $model and $model->isa('Data::Model::Row')
354 0 529 unless $schema
360 325 204 if (ref $_[0] eq 'HASH') { }
78 126 elsif (ref $_[0] eq 'ARRAY') { }
126 0 elsif (not ref $_[0]) { }
375 325 204 if ($columns) { }
112 92 elsif (ref $_[0] eq 'HASH') { }
395 8 521 $is_replace ? :
397 0 521 unless $result
399 520 1 unless ($$schema{'options'}{'bare_row'})
410 2 0 if $$self{'active_transaction'}
418 0 194 unless $class
421 0 194 unless (ref $self || $self) eq $klass
427 2 75 if $$self{'active_transaction'}
429 30 45 unless ref $row and $row->isa('Data::Model::Row')
432 0 45 unless $schema
433 4 41 unless @{$$schema{'key'};} > 0
435 0 41 unless scalar %{$row->get_changed_columns;}
441 12 29 if ($schema->has_deflate)
457 0 41 unless $result
469 2 42 if $$self{'active_transaction'}
473 0 42 unless $schema
476 0 42 unless @{$query;}
491 2 97 if $$self{'active_transaction'}
493 45 52 unless ref $row and $row->isa('Data::Model::Row')
496 0 52 unless $schema
497 4 48 unless @{$$schema{'key'};} > 0
508 2 45 if $$self{'active_transaction'}
511 0 45 unless $schema
514 0 45 unless @{$query;}
522 2 0 if $$self{'active_transaction'}
528 2 33 if $_[0]{'active_transaction'}
534 2 33 if $$self{'active_transaction'}
536 0 33 unless $driver