Branch Coverage

blib/lib/SQLite_File.pm
Criterion Covered Total %
branch 251 402 62.4


line true false branch
163 0 6 unless (eval 'require DBD::SQLite; 1')
236 11 238 unless defined $self->{'SEQIDX'}
252 0 11 if (CORE::ref($mode) =~ /INFO$/)
259 0 11 unless (defined $index and CORE::ref($index) =~ /INFO$/)
268 8 3 if ($file) { }
272 1 7 if ($_ eq 'O_SVWST')
275 6 2 if ($_ & 64)
276 4 2 unless -e $file
277 2 4 -e $file ? :
279 8 0 if ($_ & 2)
280 6 2 $infix ? :
282 1 7 if ($_ & 512)
286 0 8 unless $infix
289 0 8 unless open $fh, $infix, $file
290 4 4 if $setmode
293 3 5 unless defined $keep
300 3 0 unless defined $keep
331 0 11 unless (defined $_)
335 4 7 if ($_ eq 'BINARY')
337 2 2 if (CORE::ref $index->{'compare'} eq 'CODE')
341 3 1 if ($flags & R_DUP()) { }
353 7 0 if ($_ eq 'HASH')
357 0 0 if ($_ eq 'RECNO')
365 0 8 if $infix and $infix =~ /{'type'} eq 'BINARY'
383 0 3 if (CORE::ref($mode) =~ /INFO$/)
389 0 3 unless (defined $index and CORE::ref($index) =~ /INFO$/)
393 0 3 unless $index->{'type'} eq 'RECNO'
398 1 2 if ($file) { }
401 0 1 if ($_ eq 'O_SVWST')
404 1 0 if ($_ & 64)
405 0 1 unless -e $file
406 1 0 -e $file ? :
408 1 0 if ($_ & 2)
409 1 0 $infix ? :
411 0 1 if ($_ & 512)
415 0 1 unless $infix
418 0 1 unless open $fh, $infix, $file
419 0 1 if $setmode
422 1 0 unless defined $keep
429 2 0 unless defined $keep
452 0 3 if ($_ eq 'BINARY')
457 0 3 if ($_ eq 'HASH')
462 3 0 if ($_ eq 'RECNO')
485 0 60 unless $self->dbh
487 35 25 if (not $self->{'ref'} or $self->ref eq 'HASH') { }
25 0 elsif ($self->ref eq 'ARRAY') { }
493 24 1 if (defined do { $self->SEQIDX }->[$key]) { }
505 56 3 if ($ret) { }
523 0 49 unless $self->dbh
539 36 13 if (not defined $self->{'ref'} or $self->ref eq 'HASH') { }
13 0 elsif ($self->ref eq 'ARRAY') { }
540 17 19 if ($self->dup) { }
551 1 18 if ($self->EXISTS($key)) { }
573 12 1 if (not defined do { $self->SEQIDX }->[$key]) { }
587 0 3 unless $self->dbh
594 0 3 if $self->index->{'type'} eq 'BINARY' and $self->_index_is_stale
596 2 1 if (not $self->ref or $self->ref eq 'HASH') { }
1 0 elsif ($self->ref eq 'ARRAY') { }
597 0 2 unless $self->get_sth->execute($fkey)
602 2 0 if ($ret->[1])
608 1 0 if ($SEQIDX->[$key])
627 0 25 unless $self->dbh
630 25 0 if (not $self->ref or $self->ref eq 'HASH') { }
0 0 elsif ($self->ref eq 'ARRAY') { }
635 6 19 defined $ret ? :
647 0 2 unless $self->dbh
660 0 6 unless $self->dbh
662 0 6 if $self->{'ref'} and $self->ref ne 'HASH'
664 0 6 unless $ids
675 0 27 unless $self->dbh
676 0 27 if $self->{'ref'} and $self->ref ne 'HASH'
684 0 25 unless $self->dbh
685 0 25 if not $self->{'ref'} or $self->ref ne 'ARRAY'
692 0 0 unless $self->dbh
693 0 0 if not $self->ref or $self->ref ne 'ARRAY'
694 0 0 if ($count > $self->len) { }
0 0 elsif ($count < $self->len) { }
715 0 3 unless $self->dbh
717 0 3 if not $self->{'ref'} or $self->ref ne 'ARRAY'
724 3 0 defined $ret ? :
730 0 2 unless $self->dbh
731 0 2 if not $self->{'ref'} or $self->ref ne 'ARRAY'
744 0 3 unless $self->dbh
746 0 3 if not $self->{'ref'} or $self->ref ne 'ARRAY'
760 0 2 if not $self->{'ref'} or $self->ref ne 'ARRAY'
763 0 2 unless $self->dbh
798 0 8 if $count
806 40 105 if $$self{$_ . '_sth'}
810 0 14 unless $self->dbh->disconnect
814 14 0 if $self->_fh
815 13 1 if (-e $self->file)
817 7 6 if not $self->keep and $self->_fh
818 0 13 if $!
830 0 4 unless (not defined $code or CORE::ref $code eq 'CODE')
840 0 2 unless (not defined $code or CORE::ref $code eq 'CODE')
850 1 2 unless (not defined $code or CORE::ref $code eq 'CODE')
859 0 2 unless (not defined $code or CORE::ref $code eq 'CODE')
869 2 27 if (@_)
873 21 6 unless defined $self->{'_fetch_key_filter'}
879 2 64 if (@_)
883 57 7 unless defined $self->{'_fetch_value_filter'}
889 4 112 if (@_)
893 97 15 unless defined $self->{'_store_key_filter'}
899 2 52 if (@_)
903 45 7 unless defined $self->{'_store_value_filter'}
923 14 36 if @_
941 14 35 if @_
958 15 13 if @_
1008 6 27 if ($load)
1032 0 2 unless $self->dbh
1033 1 1 $self->ref eq 'ARRAY' ? :
1034 2 0 if defined $_[1]
1054 0 8 unless $self->dbh
1061 5 3 if (not defined $_ or $_ == R_SETCURSOR())
1062 0 5 if ($self->dup) { }
1067 0 0 if $flags
1068 0 0 if $self->index->{'type'} eq 'BINARY'
1074 2 3 $self->_last_pk ? :
1078 3 2 unless $self->_last_pk
1079 2 3 if ($flags)
1080 2 0 if ($pk = $SEQIDX->[-1]) { }
1086 1 1 if $self->index->{'type'} eq 'BINARY'
1092 1 2 if ($_ == R_IAFTER())
1093 0 1 unless $$SEQIDX[$$CURSOR]
1095 0 0 unless $self->ref eq 'ARRAY' or $self->dup or not $self->EXISTS($key)
1097 0 1 unless $self->index->{'type'} eq 'RECNO'
1102 1 0 if ($$CURSOR == $#$SEQIDX) { }
1111 1 1 if ($_ == R_IBEFORE())
1112 1 0 unless $$SEQIDX[$$CURSOR]
1114 0 0 unless $self->ref eq 'ARRAY' or $self->dup or not $self->EXISTS($key)
1116 0 1 unless $self->index->{'type'} eq 'RECNO'
1121 0 1 if ($$CURSOR) { }
1131 0 1 if ($_ == R_CURSOR())
1132 0 0 unless $$SEQIDX[$$CURSOR]
1134 0 0 unless $self->ref eq 'ARRAY' or $self->dup or not $self->EXISTS($key)
1138 0 0 if $self->index->{'type'} eq 'BINARY'
1142 1 0 if ($_ == R_NOOVERWRITE())
1144 1 0 unless $self->ref eq 'ARRAY' or $self->dup or not $self->EXISTS($key)
1149 0 0 if $self->index->{'type'} eq 'BINARY'
1154 4 3 if ($self->ref eq 'ARRAY') { }
1164 7 0 unless $status
1166 3 4 if $self->index->{'type'} eq 'BINARY'
1183 0 2 unless $self->dbh
1184 0 2 if $self->index->{'type'} eq 'BINARY' and $self->_index_is_stale
1188 2 0 if ($flags eq R_CURSOR()) { }
1189 0 2 unless $$SEQIDX[$$CURSOR]
1192 2 0 if ($status)
1205 2 0 if $status
1228 0 34 unless $flags
1231 3 31 if $self->index->{'type'} eq 'BINARY' and $self->_index_is_stale
1235 6 28 if ($_ eq R_CURSOR())
1238 6 22 if ($_ eq R_FIRST())
1242 4 18 if ($_ eq R_LAST())
1246 14 4 if ($_ eq R_NEXT())
1247 3 11 if $$CURSOR >= $#$SEQIDX
1251 4 0 if ($_ eq R_PREV())
1252 2 2 if $$CURSOR == 0
1257 2 27 unless defined $$SEQIDX[$$CURSOR]
1259 3 26 if ($flags == R_CURSOR() and $self->ref eq 'HASH') { }
1267 12 14 $self->ref eq 'ARRAY' ? :
1299 4 46 if @_
1318 0 3 unless $self->dbh
1320 0 3 unless ($self->dup)
1326 1 2 unless wantarray
1328 1 1 if (not $want_hash) { }
1353 0 1 unless $self->dbh
1355 0 1 unless ($self->dup)
1363 0 1 unless $ret
1382 0 0 unless $self->dbh
1383 0 0 unless ($self->dup)
1391 0 0 unless ($ret)
1396 0 0 if ($self->del_dup_sth->execute) { }
1428 0 3 unless ($self->ref ne 'ARRAY')
1434 3 0 unless ($status)
1435 3 0 if ($ret = $self->{'part_seq_sth'}->fetch)
1438 0 3 unless (defined($$CURSOR = _find_idx($pk, $SEQIDX)))
1462 14 707 if @_
1481 0 349 unless $self->dbh
1483 0 349 unless ($tbl)
1486 40 309 unless ($$self{"${desc}_sth"})
1487 0 40 unless grep /^$desc$/, keys %$tbl
1500 0 349 unless ($desc =~ /^(.*?)_sth$/)
1504 349 0 if (defined $desc) { }
1505 0 349 unless (grep /^$desc$/, keys %{$STMT{$self->ref};})
1530 14 135 if (@_ or $self->{'pending'} > $SQLite_File::MAXPEND)
1531 0 14 unless $self->dbh->commit
1564 0 0 unless $self->dbh
1603 0 0 unless $self->index->{'type'} eq 'BINARY'
1606 0 0 unless ($q)
1630 0 4 unless $self->index->{'type'} eq 'BINARY'
1636 0 4 unless ($q)
1640 4 0 if (defined $$CURSOR) { }
1667 0 39 unless defined $seqidx->[$_]
1668 10 29 if $pk == $seqidx->[$_]
1688 2 8 unless defined $$CURSOR
1692 62 4 if (defined $SEQIDX->[$i]) { }
1693 10 52 if $$CURSOR == $i
1697 4 0 if $$CURSOR == $i
1734 85 16 if @_
1750 39 16 if defined $SEQIDX->[$index]
1773 0 4 unless (delete do { $self->SEQIDX }->[$index])