Branch Coverage

blib/lib/ObjectDB.pm
Criterion Covered Total %
branch 22 180 12.2


line true false branch
44 0 8 if ref $class
51 3 1 if ($self->meta->is_column($column) or $self->meta->is_relationship($column))
67 0 0 if (@_)
88 0 0 ref $self ? :
91 0 0 if (@_) { }
92 0 0 if (@_ == 1 and ref $_[0]) { }
104 0 0 unless ($dbh)
107 0 0 if ($dbh = ${"${parent}::DBH";})
113 0 0 unless $dbh
116 0 0 $dbh->isa('ObjectDB::DBHPool') ? :
134 0 0 unless (eval { do { $dbh->{'AutoCommit'} = 0; $retval = &$cb($self); $self->commit } })
150 0 0 if ($dbh->{'AutoCommit'} == 0)
163 0 0 if ($dbh->{'AutoCommit'} == 0)
173 33 9 if ref $class
180 0 0 ref $self ? :
190 0 0 if (exists $self->{'columns'}{$key})
203 0 0 if (@_ == 1) { }
0 0 elsif (@_ == 2) { }
217 6 2 if ($self->meta->is_column($name)) { }
0 2 elsif ($self->meta->is_relationship($name)) { }
220 3 3 if (exists $self->{'columns'}{$name}) { }
224 1 2 if (exists $self->meta->get_column($name)->{'default'})
226 0 1 ref $default eq 'CODE' ? :
230 4 2 if (defined $value and $value ne '')
231 0 4 if (my $type = $self->meta->get_column($name)->{'type'})
232 0 0 if ($type eq 'number') { }
0 0 elsif ($type eq 'string') { }
245 0 0 exists $self->{'relationships'}{$name} ? :
255 0 1 ref $_[0] ? :
268 6 1 if ($self->meta->is_column($name)) { }
0 1 elsif ($self->meta->is_relationship($name)) { }
269 2 0 unless (defined $value or $self->meta->is_nullable($name))
275 4 0 unless (exists $self->{'columns'}{$name} and (defined $self->{'columns'}{$name} and defined $value and $self->{'columns'}{$name} eq $value))
284 0 0 if (&Scalar::Util::blessed($value)) { }
0 0 elsif (ref $value eq 'ARRAY') { }
0 0 elsif (not $self->_is_empty_hash_ref($value)) { }
290 0 0 unless defined $sub_value and ref $sub_value
292 0 0 unless ref $sub_value
294 0 0 if (&Scalar::Util::blessed($sub_value)) { }
0 0 elsif (ref $sub_value eq 'HASH') { }
298 0 0 unless ($self->_is_empty_hash_ref($sub_value))
307 0 0 unless @$related_value
313 0 0 if ($related_value)
314 0 0 if ($self->meta->get_relationship($name)->is_multi and ref $related_value ne 'ARRAY')
336 0 0 if $self->meta->is_primary_key($column) or $self->meta->is_unique_key($column)
347 0 0 if $self->is_in_db
361 0 0 if (my $auto_increment = $self->meta->auto_increment)
370 0 0 if (my $rel_values = $self->{'relationships'}{$rel_name})
371 0 0 if (ref $rel_values eq 'ARRAY') { }
373 0 0 unless @$rel_values
376 0 0 if $rel_values->is_in_db
382 0 0 $rel->is_multi ? :
393 0 0 if ($self->is_in_db) { }
410 0 0 if $self->meta->is_primary_key($name)
413 0 0 unless (@columns)
415 0 0 if $self->meta->is_unique_key($name)
419 0 0 unless @columns
441 0 0 unless $rows and @$rows
461 0 0 if $self->meta->is_primary_key($name)
464 0 0 unless (@columns)
466 0 0 if $self->meta->is_unique_key($name)
471 0 0 if @columns
480 0 0 unless $self->is_modified
484 0 0 if $self->meta->is_primary_key($name)
488 0 0 unless (keys %where)
490 0 0 if $self->meta->is_unique_key($name)
495 0 0 unless keys %where
513 0 0 if $rv eq '0E0'
526 0 0 if $self->meta->is_primary_key($name)
530 0 0 unless (keys %where)
532 0 0 if $self->meta->is_unique_key($name)
537 0 0 unless keys %where
549 0 0 if $rv eq '0E0'
562 0 0 if (exists $self->{'columns'}{$key}) { }
0 0 elsif (exists $self->meta->get_column($key)->{'default'}) { }
576 0 0 unless defined $rel
578 0 0 unless $rel
580 0 0 if (ref $rel eq 'ARRAY') { }
604 0 0 unless ($self->{'relationships'}{$name})
605 0 0 $rel->is_multi ? :
615 0 0 ref $related eq 'ARRAY' ? :
0 0 wantarray ? :
630 0 0 ref $_[0] eq 'ARRAY' ? :
0 0 @_ == 1 ? :
633 0 0 @rv == 1 ? :
641 0 0 unless $name
662 0 0 unless defined $hash_ref and ref $hash_ref eq 'HASH'
665 0 0 if (defined $hash_ref->{$key} and $hash_ref->{$key} ne '')
666 0 0 if (ref $hash_ref->{$key} eq 'HASH') { }
668 0 0 unless $is_empty