Branch Coverage

blib/lib/Sql/Simple.pm
Criterion Covered Total %
branch 124 338 36.6


line true false branch
254 0 6 if (ref $_[0] eq 'DBI::db') { }
259 0 0 unless $Sql::Simple::RETURNSQL or ref $dbh
261 3 3 if (scalar @_ <= 4) { }
268 2 4 if (ref $where eq 'HASH') { }
2 2 elsif (ref $where eq 'ARRAY' and scalar @{$where;} > 1 and &_clause('', $$where[0], []) ne &_clause('', $$where[1], [])) { }
277 6 0 if ($where) { }
285 0 0 if ($@) { }
286 0 0 unless $$dbh{'Autocommit'}
288 0 0 unless $$dbh{'AutoCommit'}
295 0 6 if $Sql::Simple::DEBUGSQL
296 6 0 if $Sql::Simple::RETURNSQL
299 0 0 if $sql =~ /OR\n/
300 0 0 if $_ ne 'VALUE'
303 0 0 if $@
304 0 0 if ($simple == 0) { }
311 0 0 if $@
319 0 0 if $@
322 0 0 unless $$dbh{'AutoCommit'}
384 0 8 if (ref $_[0] eq 'DBI::db') { }
389 0 0 unless $Sql::Simple::RETURNSQL or ref $dbh
391 4 4 if (scalar @_ <= 5) { }
400 6 2 if (ref $set eq 'HASH') { }
407 4 4 if (ref $where eq 'HASH') { }
0 4 elsif (ref $where eq 'ARRAY' and scalar @{$where;} > 1 and &_clause('', $$where[0], []) ne &_clause('', $$where[1], [])) { }
417 0 8 if not $singleset and $singlewhere
425 8 0 if ($where) { }
429 0 0 if $Sql::Simple::RETURNSQL
433 0 0 unless $$dbh{'AutoCommit'}
438 0 8 if $sql =~ /OR\n/
439 2 22 if $_ ne 'VALUE'
440 0 8 if $Sql::Simple::DEBUGSQL
441 8 0 if $Sql::Simple::RETURNSQL
443 0 0 if $@
446 0 0 if ($simple == 0) { }
448 0 0 if ($singleset) { }
461 0 0 if $@
465 0 0 if ($singleset) { }
481 0 0 unless $$dbh{'AutoCommit'}
555 0 5 if (ref $_[0] eq 'DBI::db') { }
560 0 0 unless $Sql::Simple::RETURNSQL or ref $dbh
564 4 1 if (ref $temp eq 'ARRAY') { }
1 0 elsif (ref $temp eq 'HASH') { }
565 1 3 if (ref $$temp[0] eq 'HASH') { }
580 4 1 if (ref $values eq 'ARRAY') { }
1 0 elsif (ref $values eq 'HASH') { }
582 1 3 if (ref $$values[0] eq 'HASH') { }
583 0 1 if ($$values[0]{'table'}) { }
590 0 2 if ref $_ eq 'SCALAR'
592 1 1 if ref $$values[0]{$_} eq 'SCALAR'
1 0 if ref $$values[0] eq 'HASH'
594 1 0 if ($simpleCheck) { }
602 0 6 if ref $_ and ref $_ ne 'ARRAY'
604 0 3 if ($simpleCheck) { }
611 1 0 if ($$values{'table'})
620 0 5 if $Sql::Simple::DEBUGSQL
621 5 0 if $Sql::Simple::RETURNSQL
624 0 0 if (ref $map eq 'ARRAY' and scalar @{$map;}) { }
625 0 0 if (ref $$values[0] eq 'HASH') { }
626 0 0 if (defined $$values[0]{'where'}) { }
640 0 0 if (ref $$values[0] eq 'ARRAY') { }
645 0 0 if ($@)
646 0 0 unless $$dbh{'AutoCommit'}
651 0 0 if (ref $$values[0] eq 'HASH') { }
652 0 0 if ($$values[0]{'table'}) { }
653 0 0 if (ref $map) { }
665 0 0 if ($@)
666 0 0 unless $$dbh{'AutoCommit'}
678 0 0 unless $$dbh{'AutoCommit'}
843 11 24 unless $_[0]
845 0 35 if (ref $_[0] eq 'DBI::db') { }
0 35 elsif (ref $class and ref $$class{'dbh'}) { }
854 23 182 if $_ eq 'table'
23 12 if (grep {1 if $_ eq 'table';} @_) { }
867 15 20 unless defined $return
869 0 0 unless $Sql::Simple::RETURNSQL or ref $dbh or $return
872 0 35 if ($distinct)
878 6 29 if (ref $table eq 'ARRAY') { }
0 29 elsif (ref $table eq 'HASH') { }
29 0 elsif ($table) { }
883 0 0 if scalar keys %{$table;} > 1
885 0 0 if ref $$table{$ft}
897 6 2 unless ($where or scalar @{$map;})
898 0 6 if $Sql::Simple::DEBUGSQL
899 6 0 if $return or $Sql::Simple::RETURNSQL
904 0 0 if (ref $class and $$class{'state'})
909 0 0 if ($col and not ref $col) { }
925 27 2 if ($where)
930 0 29 if $order
932 0 29 if ref $col eq 'ARRAY'
935 11 18 if $return == 2
936 0 18 if $Sql::Simple::DEBUGSQL
937 18 0 if $return == 1 or $Sql::Simple::RETURNSQL
944 0 0 if $sql =~ /OR\n/
945 0 0 if $_ ne 'VALUE'
948 0 0 if (scalar keys %{$tables;} > 0) { }
956 0 0 if ($$_{'on'}) { }
0 0 elsif ($_) { }
965 0 0 if ($simple == 0) { }
0 0 elsif (not $where) { }
980 0 0 if ($@)
986 0 0 if (ref $class and $$class{'state'})
992 0 0 if ($col and not ref $col) { }
1012 0 0 if (ref $_[0] eq 'DBI::db') { }
0 0 elsif (ref $class and ref $$class{'dbh'}) { }
1021 0 0 if $Sql::Simple::DEBUGSQL
1024 0 0 if ($sql =~ /^[\s\n]*select/i) { }
1025 0 0 if ($struct) { }
1031 0 0 if (ref $class) { }
1035 0 0 if ($Sql::Simple::ASARRAY) { }
0 0 elsif ($col) { }
1053 0 0 if (ref $$struct[0] eq 'ARRAY') { }
1068 0 0 if (ref $_[0] eq 'DBI::db') { }
0 0 elsif (ref $class and ref $$class{'dbh'}) { }
1079 0 0 if (ref $arguments eq 'ARRAY' and scalar @{$arguments;} > 0)
1082 0 0 if (defined $$arguments[$a] and $$types{$a} eq 'number') { }
0 0 elsif (defined $$arguments[$a] and $$types{$a} eq 'string') { }
0 0 elsif ($$arguments[$a] =~ /^\-?\d+\.?\d*$/) { }
0 0 elsif (defined $$arguments[$a]) { }
0 0 elsif (not defined $$arguments[$a]) { }
1097 0 0 if $Sql::Simple::DEBUGSQL
1098 0 0 if $Sql::Simple::RETURNSQL
1102 0 0 if ($col) { }
1123 0 1 if (ref $values eq 'ARRAY') { }
1125 0 0 if (ref $c) { }
1135 1 1 if (ref $$values{$k}) { }
1151 29 6 if $tab
1153 6 29 if (ref $columns eq 'HASH') { }
23 6 elsif (ref $columns eq 'ARRAY') { }
1156 10 2 if (defined $$columns{$k}) { }
1157 2 8 if ($k =~ /[\s\.]/) { }
1158 0 2 if (ref $$columns{$k} eq 'ARRAY') { }
1165 4 4 if (ref $$columns{$k} eq 'ARRAY') { }
1172 0 2 if ($k =~ /[\s\.]/) { }
1181 0 42 $_ =~ /[\s\.]/ ? :
1184 2 4 if ($columns =~ /[\s\,]/) { }
1186 0 4 $_ =~ /\s\.]/ ? :
1203 6 8 if (ref $s eq 'HASH') { }
1205 0 6 $$s{'join'} ? :
1210 6 0 if (ref $$s{'on'} eq 'HASH') { }
0 0 elsif (ref $$s{'on'} eq 'ARRAY') { }
1219 2 6 if $s ne $$struct[0]
1231 20 75 if (ref $tsql) { }
1237 6 89 if (ref $where eq 'ARRAY')
1240 0 14 if ref $wa eq 'ARRAY'
1243 0 14 if ref $wa eq 'ARRAY'
1255 18 101 if (ref $$where{$w} eq 'HASH') { }
1256 10 8 if ($$where{$w}{'table'}) { }
1267 0 8 if ($$where{$w}{'allowNull'})
1272 0 8 if (ref $$where{$w}{'val'} eq 'ARRAY') { }
0 8 elsif (ref $$where{$w}{'val'} eq 'SCALAR') { }
0 8 elsif (defined $$where{$w}{'val2'}) { }
1277 0 0 ${$$where{$w};} =~ /\s/ ? :
1287 0 8 if ($$where{$w}{'allowNull'})
1293 8 93 if (ref $$where{$w} eq 'ARRAY') { }
6 87 elsif (ref $$where{$w} eq 'SCALAR') { }
1297 4 2 ${$$where{$w};} =~ /\s/ ? :
1302 8 79 if ($from and $$from{substr $w, 0, index($w, '.')} and $$from{substr $$where{$w}, 0, index($$where{$w}, '.')}) { }
1329 0 0 unless ($c)
1337 0 0 if (ref $value eq 'HASH') { }
0 0 elsif (ref $value eq 'ARRAY') { }
1341 0 0 if ($$map[${$c;}] eq 'VALUE') { }
0 0 elsif ($$map[${$c;}] eq 'ARRAY') { }
0 0 elsif ($$map[${$c;}] eq 'VAL2') { }
0 0 elsif ($$map[${$c;}] eq 'VAL') { }
0 0 elsif ($$map[${$c;}] eq 'HASH-ARRAY') { }
0 0 elsif ($$map[${$c;}] eq 'SCALAR') { }
0 0 elsif (ref $$map[${$c;}]) { }
1363 0 0 if (ref $$value[0] ne 'SCALAR') { }
1372 0 0 if $$map[${$c;}] eq 'VALUE'