Condition Coverage

blib/lib/DBIx/DataStore.pm
Criterion Covered Total %
condition 61 198 30.8


and 3 conditions

line !l l&&!r l&&r condition
897 2 0 0 defined $t{'debug'} && $t{'debug'} =~ /^\d+$/o
0 2 0 not defined $t{'debug'} && $t{'debug'} =~ /^\d+$/o and defined $ENV{'DATASTORE_DEBUG'}
2 0 0 not defined $t{'debug'} && $t{'debug'} =~ /^\d+$/o and defined $ENV{'DATASTORE_DEBUG'} and $ENV{'DATASTORE_DEBUG'} =~ /^\d+$/o
898 2 0 0 defined $t{'debug'} and $t{'debug'} =~ /^\d+$/o
913 2 0 0 defined $t{'use_home'} and $t{'use_home'} =~ /^\d+$/o
915 2 0 0 defined $t{'config'} and length $t{'config'} > 0
931 0 0 1 scalar @_ > 0 and ref $_[0] eq 'HASH'
944 0 0 0 $opts->{'config'} =~ m[^/] and -r $opts->{'config'}
997 1 0 0 $found_config != 1 and defined $opts->{'store'}
1 0 0 $found_config != 1 and defined $opts->{'store'} and length $opts->{'store'} > 0
1007 1 0 0 $found_config != 1 and scalar @args > 0
1019 0 0 0 defined $self->{'config'}{'readers'} and ref $self->{'config'}{'readers'} eq 'ARRAY'
1070 1 0 0 defined $self->{'config'}{'readers'} && ref $self->{'config'}{'readers'} eq 'HASH'
1084 0 1 0 defined $self->{'config'}{'default_reader'} and $self->{'config'}{'default_reader'} ne 'primary'
1136 0 0 0 defined $self->{'config'}{'primary'}{'dbd_opts'} && ref $self->{'config'}{'primary'}{'dbd_opts'} eq 'HASH' && defined $self->{'config'}{'primary'}{'dbd_opts'}{'AutoCommit'} && $self->{'config'}{'primary'}{'dbd_opts'}{'AutoCommit'} == 0
1187 0 0 0 defined $self->{'config'}{'primary'}{'schemas'} and ref $self->{'config'}{'primary'}{'schemas'} eq 'ARRAY'
1256 2 0 0 $self->{'st_count'} == 0 and $self->{'in_tx'} == 1
2 0 0 $self->{'st_count'} == 0 and $self->{'in_tx'} == 1 and $self->{'autocommit'} == 0
1308 1 0 0 $self->{'autocommit'} == 0 and defined $self->{'config'}{'primary'}{'schemas'}
1381 0 0 0 defined $self->{'config'}{'default_reader'} and exists $self->{'config'}{'readers'}{$self->{'config'}{'default_reader'}}
1396 12 6 1 scalar @args > 1 and ref $args[0] eq 'HASH'
1404 18 0 1 defined $opts->{'per_page'} and $opts->{'per_page'} =~ /^\d+$/o
1405 18 0 1 defined $opts->{'page'} and $opts->{'page'} =~ /^\d+$/o
1409 19 0 0 defined $opts->{'prepare'} and $opts->{'prepare'} =~ /^\d+$/o
1424 8 0 0 exists $self->{'config'}{'reader_failover'} and $self->{'config'}{'reader_failover'} == 1
1425 0 0 0 exists $self->{'config'}{'flag_bad_readers'} && $self->{'config'}{'flag_bad_readers'} == 1
1551 0 0 0 defined $self->{'config'}{'cache_statements'} and $self->{'config'}{'cache_statements'} == 1
1580 11 0 8 $st_type ne 'select' and not $sql =~ /\s+returning\s+\w+(\s*,\s*\w+)*\s*/iso
1630 0 0 1 defined $self->{'in_tx'} and $self->{'in_tx'} > 0
1716 2 0 0 $self->{'autocommit'} == 0 and defined $self->{'config'}{'primary'}{'schemas'}
1728 0 0 1 defined $savepoint and $savepoint =~ /\w+/o
1760 0 0 0 defined $schemas and ref $schemas eq 'ARRAY'
1780 0 0 0 defined $self->{'config'}{'primary'}{'schemas'} and ref $self->{'config'}{'primary'}{'schemas'} eq 'ARRAY'
0 0 0 defined $self->{'config'}{'primary'}{'schemas'} and ref $self->{'config'}{'primary'}{'schemas'} eq 'ARRAY' and scalar @{$self->{'config'}{'primary'}{'schemas'};} > 0
1824 0 0 0 defined $self->{'config'}{'primary'}{'schemas'} and ref $self->{'config'}{'primary'}{'schemas'} eq 'ARRAY'
1892 0 0 0 defined $self->{'config'}{'primary'}{'schemas'} and ref $self->{'config'}{'primary'}{'schemas'} eq 'ARRAY'
1956 0 0 0 $self->{'st_count'} == 0 and $self->{'in_tx'} == 1
0 0 0 $self->{'st_count'} == 0 and $self->{'in_tx'} == 1 and $self->{'autocommit'} == 0
1975 0 0 1 defined $args{'dsn'} and length $args{'dsn'} > 0
2004 0 0 0 defined $args{'port'} and $args{'port'} =~ /^\d+$/
2014 1 0 0 $args{'cache'} and $dbh = 'DBI'->connect_cached($dsn, $args{'user'}, $args{'password'}, $args{'dbd_opts'})
0 0 1 not $args{'cache'} and $dbh = 'DBI'->connect($dsn, $args{'user'}, $args{'password'}, $args{'dbd_opts'})
2090 5 0 1 $st_type eq 'update' and $sql =~ /\s+set\s+$HASH_PH/iso
5 1 0 $st_type eq 'update' and $sql =~ /\s+set\s+$HASH_PH/iso and scalar @binds < 1 || ref $binds[0] ne 'HASH'
4 0 2 $st_type eq 'insert' and $sql =~ /^\s*insert\s+into\s+\S+\s+(values\s+)?$HASH_PH/iso
4 2 0 $st_type eq 'insert' and $sql =~ /^\s*insert\s+into\s+\S+\s+(values\s+)?$HASH_PH/iso and scalar @binds < 1 || !(ref $binds[0] eq 'ARRAY' || ref $binds[0] eq 'HASH')
3 0 3 $st_type eq 'select' and scalar @binds > 0
2106 5 0 1 $st_type eq 'update' and $sql =~ /$HASH_PH/o
2122 4 0 2 $st_type eq 'insert' and $sql =~ /^\s*insert\s+into\s+\S+\s+(values\s+)?$HASH_PH/iso
2185 3 3 0 scalar grep({$st_type eq $_;} 'insert', 'update', 'delete') > 0 and $sql =~ /\s+returning\s+(\*|\w)/iso

or 2 conditions

line l !l condition
1065 1 0 _set_schema_searchpath($self->{'handles'}{'primary'}, $self->{'config'}{'primary'}{'driver'}, $self->{'config'}{'primary'}{'schemas'}) || die(dslog('Error setting schema search path.'))
1688 1 0 $self->{'handles'}{'primary'}->quote($savepoint) || die(dslog('Error encountered when safe-quoting savepoint name:', $self->{'handles'}{'primary'}->errstr))
1745 1 0 $self->{'handles'}{'primary'}->quote($savepoint) || die(dslog('Error encountered when safe-quoting savepoint name: ' . $self->{'handles'}{'primary'}->errstr))

or 3 conditions

line l !l&&r !l&&!r condition
999 0 0 0 $@ or not defined $self->{'config'}
1009 0 0 0 $@ or not defined $self->{'config'}
1038 0 0 0 $@ or not defined $self->{'config'}
1049 0 0 0 $@ or not defined $self->{'config'}
1076 1 0 0 not defined $self->{'config'}{'default_reader'} or lc $self->{'config'}{'default_reader'} eq 'none'
1 0 0 not defined $self->{'config'}{'default_reader'} or lc $self->{'config'}{'default_reader'} eq 'none' or length $self->{'config'}{'default_reader'} < 1
0 0 0 not defined $self->{'config'}{'default_reader'} or lc $self->{'config'}{'default_reader'} eq 'none' or length $self->{'config'}{'default_reader'} < 1 or $num_readers < 1
1421 5 6 8 $self->{'in_tx'} > 0 or $st_type ne 'select'
1522 0 0 1 $sql =~ /limit\s+\d+(\s+offset\s+\d+|\s*,\s*\d+)\s*$/iso or $sql =~ /rows\s+\d+(\s+to\s+\d+)\s*$/iso
2043 0 0 0 not defined $schemas or ref $schemas ne 'ARRAY'
0 0 0 not defined $schemas or ref $schemas ne 'ARRAY' or scalar @{$schemas;} < 1
2085 13 0 6 not @binds or scalar @binds < 1
2090 0 0 1 scalar @binds < 1 || ref $binds[0] ne 'HASH'
0 0 2 scalar @binds < 1 || !(ref $binds[0] eq 'ARRAY' || ref $binds[0] eq 'HASH')