Branch Coverage

blib/lib/Data/ObjectStore.pm
Criterion Covered Total %
branch 305 308 99.0


line true false branch
42 1 66 if 0 == @options
44 34 32 if (1 == @options)
50 64 2 unless (ref $data_provider)
55 2 19 ref $options{'CACHE'} ? :
21 45 $options{'CACHE'} ? :
65 63 3 unless ($UPGRADING)
68 1 62 if ($store->get_store_version < 1.2)
82 1 1 if ($self->[5])
117 24 7 if not $keep{$_}
119 4 27 ref $d eq 'ARRAY' ? :
125 17 29 unless ($keep{$i})
138 1 2 if -e "$dest_path/RECORDSTORE"
148 1 1 if ($vers >= 2)
171 3 5 if ($obj)
183 3 2 unless (ref($clone_thing) =~ /^(ARRAY|HASH|Data::ObjectStore::Hash|Data::ObjectStore::Array)$/)
196 1 4 if (ref $odata eq 'ARRAY') { }
199 3 1 if ($oid > 0)
201 2 1 if ($oid != $id)
209 7 7 if ($odata->{$key} > 0)
212 5 2 if ($oid != $id)
240 29 111 unless ($root)
279 10 58 if (ref $class)
285 6 62 unless ($class =~ /^Data::ObjectStore::/)
314 24 144 if (ref $ref)
320 144 0 unless ($self->[4]{'NO_TRANSACTIONS'})
341 144 0 unless ($self->[4]{'NO_TRANSACTIONS'})
351 288 7158 unless (ref($thingy) =~ /^(ARRAY|HASH|Data::ObjectStore::Hash|Data::ObjectStore::Array)$/)
352 5 283 unless ($thingy->[5])
364 1 7440 $class_override ? :
376 1 2 unless ref $obj
378 1 1 $tied ? :
389 74618 463 if ($r)
390 71544 3074 if ($r eq 'ARRAY') { }
2093 981 elsif ($r eq 'HASH') { }
979 2 elsif ($r eq 'Data::ObjectStore::Array' or $r eq 'Data::ObjectStore::Hash' or $r->isa('Data::ObjectStore::Container')) { }
403 459 4 if ($item > 0)
417 29 319 unless ($node)
442 33 285 if (0 < grep({/\\$/;} @$pieces))
452 123 275 if ($part =~ /(^|[^\\])((\\\\)+)?[\\]$/) { }
95 180 elsif ($is_hanging) { }
453 28 95 if ($is_hanging) { }
482 62610 362 if $ref
485 44 318 unless $stowed
488 2 316 if $pos == -1
502 8 308 unless ($class =~ /^Data::ObjectStore::/)
508 2 3 unless ($class->can('_reconstitute'))
509 1 1 if ($force) { }
517 4 4 if ($@)
518 1 3 if ($force) { }
539 188 23258 if (ref $val)
543 22842 416 defined $val ? :
552 2018 6263 unless defined $val and $val ne 'u'
554 5419 844 if (index($val, 'v') == 0)
557 381 463 if ($val =~ /^r(\d+)/)
566 542 7001 if ($self->[5])
581 59381 16 if ($item)
604 1 3 unless $obj
611 1 3 unless $obj
623 62 134 if ($class eq 'ARRAY') { }
24 110 elsif ($class eq 'HASH') { }
625 46 16 unless ($thingy)
641 18 6 unless ($thingy)
661 3 123 unless $class eq 'Data::ObjectStore::Hash' or $class eq 'Data::ObjectStore::Array' or $ref->isa('Data::ObjectStore::Container')
711 151 6964 $self->[5] > $self->[7] ? :
712 7046 69 if ($stuff_count > 0)
713 6 28143 if (defined $_ and $_ =~ /[\\\`]/)
27792 357 defined $_ ? :
761 17281 32135 if ($idx >= $self->[7])
765 3868 28267 if ($self->[4] == 0)
830 61322 6975 if ($block_id > 0)
844 1736 5239 if ($block_idx >= $self->[5] - 1)
859 23 50983 if ($idx >= $self->[5] * $self->[6])
865 27410 23573 if ($idx >= $self->[7])
871 13810 37173 if ($self->[4] == 0)
873 2 13807 if ($xid > 0 and $xid < 3)
878 13781 26 if ($xold ne $xin)
901 2 8 if ($current_oversize > 0)
911 19 43 if ($idx >= $self->[7])
914 15 28 if ($self->[4] == 0)
927 20 3 if ($idx == $self->[7] - 1)
942 12 1 if ($self->[7] > 0)
954 32 56 unless @vals
960 1 22 if ($idx < 0)
970 2 19 unless $self->[7]
977 1 18 unless @vals
985 1 2999 unless (defined $offset)
991 1 2999 if ($offset < 0)
997 2 2998 if ($remove_length < 0)
1001 1 2999 unless $remove_length or @vals
1004 2163 836 if ($offset > $self->[7] - 1)
1008 13 2986 if ($remove_length > $self->[7] - $offset)
1020 18 2981 if ($new_size > $self->[6] * $self->[5])
1028 1946 1053 if ($self->[4] == 0)
1035 4 7641 if ($inid and $inid < 3)
1060 59 994 if ($remove_length)
1076 774 279 if (@vals)
1089 34 8 if ($bubble_size > 0)
1093 23 19 @vals > $BLOCK_SIZE - $block_off ? :
1101 87 2700 if ($remmy > @vals)
1169 6 3015 if ($_ =~ /[\\\`]/)
4 41 $self->[4] ? :
1186 42 34 unless ($buckets)
1189 4 72 $level ? :
1202 3 1 if ($self->[6] > 0)
1206 2 1 if ($self->[4] == 0) { }
1217 2 7 unless $self->EXISTS($key)
1224 5 2 if ($self->[4] == 0) { }
1243 3197 242 if ($self->[4] == 0) { }
1253 240 2 if ($hash_id > 0)
1267 1853 424 if ($self->[4] == 0) { }
1276 423 1 if ($hash)
1289 22 1535 if ($xid > 0)
1290 11 11 if ($xid < 3)
1299 1537 9 unless ($self->EXISTS($key))
1304 1516 30 if ($self->[4] == 0) { }
1306 1515 1 if ($xin ne $oldin)
1310 4 1511 if ($self->[6] > $Data::ObjectStore::Hash::MAX_SIZE)
1325 30 22 if ($hash) { }
1364 28 2 if ($hash_id > 0) { }
1389 187 26 if ($self->[4] == 0)
1392 158 29 wantarray ? :
1402 3437 2799 if ($lvl == 0) { }
1404 651 2786 wantarray ? :
1411 26 2773 if ($at_start)
1418 2148 651 unless ($hash)
1420 158 1990 if $hash_id > 1
1423 809 1990 if ($hash)
1425 158 651 $at_start ? :
1426 651 158 if (defined $k)
1428 0 651 wantarray ? :
1435 26 2122 if ($self->[7][0] > $#$data)
1481 7 1 if ref $_[1]
1482 2 1 unless not ref $_[1]
1483 2 1 if ref $_[1]
1484 2 1 unless not ref $_[1]
1494 4 43 if ($self->[0] > 2 and $inid > 0 and $inid < 3)
1500 406 1 if (not defined $self->[1]{$fld} or $oldval ne $inval)
1503 7 399 unless (defined $val)
1530 21 560 if (!defined($cur) || $cur eq 'u' and defined $default)
1532 2 14 if (ref $default and $self->[0] > 2 and $xid < 3)
1550 1 1 unless (@keys)
1560 6 6 if (defined $val)
1588 2 95 if ($func =~ /:add_to_(.*)/) { }
1 94 elsif ($func =~ /:add_once_to_(.*)/) { }
1 93 elsif ($func =~ /:remove_from_(.*)/) { }
1 92 elsif ($func =~ /:remove_all_from_(.*)/) { }
53 39 elsif ($func =~ /:set_(.*)/) { }
38 1 elsif ($func =~ /:get_(.*)/) { }
1608 2 7 unless (grep {$val eq $_;} @$arry)
1627 3 8 if ($arry->[$i] eq $val)
1648 7 16 if ($arry->[$i] eq $val)
1708 25 2037 if (defined $_ and $_ =~ /[\\\`]/)
2059 3 defined $_ ? :
1714 3 151 if ($cls ne 'Data::ObjectStore::Container')