Branch Coverage

blib/lib/SQL/Abstract.pm
Criterion Covered Total %
branch 194 254 76.3


line true false branch
13 0 14 if ($] < 5.009005) { }
23 0 14 $ENV{'SQLA_ISVALUE_IGNORE_AUTOGENERATED_STRINGIFICATION'} ? :
63 1159 0 unless $_[0]{'debug'}
80 9 28 ref $_[0] eq 'REF' && ref ${$_[0];} eq 'ARRAY' ? :
13 37 ref $_[0] eq 'SCALAR' ? :
127 32 11 defined($_[1] = &Scalar::Util::blessed($_[0])) && (grep({*{qq[${_}::(""];}{'CODE'};} @{$_[2] = &mro::get_linear_isa($_[1]);}) || (grep({*{"${_}::(0+";}{'CODE'};} @{$_[2];}) || grep({*{"${_}::(bool";}{'CODE'};} @{$_[2];})) && !((($_[3]) = grep({*{"${_}::()";}{'CODE'};} @{$_[2];})) && defined ${"$_[3]::()";} && !${"$_[3]::()";})) ? :
2 43 ref $_[0] eq 'HASH' && keys %{$_[0];} == 1 && exists $_[0]{'-value'} ? :
2 45 !length(ref $_[0]) ? :
144 101 509 ref $_[0] eq 'HASH' ? :
147 2 608 if $opt{'case'} and $opt{'case'} ne 'lower'
150 8 602 $opt{'logic'} ? :
198 5 1794 if ($_[1] =~ /$_[0]{'injection_guard'}/mix)
221 10 37 if ($options->{'returning'})
227 47 0 wantarray ? :
265 0 21 unless $self->{'bindtype'} ne 'columns'
314 4 1 if ($self->{'array_datatypes'}) { }
371 0 38 unless ref $data eq 'HASH'
378 30 6 if ($where)
384 6 30 if ($options->{'returning'})
390 36 0 wantarray ? :
404 4 0 if ($self->{'array_datatypes'}) { }
427 0 4 if @rest or not $op =~ /^\-(.+)/
469 9 80 ref $fields eq 'ARRAY' ? :
475 75 14 wantarray ? :
492 6 4 if ($options->{'returning'})
498 10 0 wantarray ? :
519 462 46 $sql ? :
522 50 458 if ($order)
528 508 0 wantarray ? :
542 1346 0 if (wantarray) { }
562 0 395 unless $logic eq 'AND' or $logic eq 'OR'
571 30 658 if defined $el and not length $el
577 15 0 if @$el
585 272 1 if %$el
597 623 1 if ($sql)
630 225 1167 if ($k =~ /^-./) { }
648 19 0 unless &List::Util::first(sub { $op =~ /$_->{'regex'}/; } , @{$$self{'unary_ops'};}) or defined $self->{'_nested_func_lhs'} and $self->{'_nested_func_lhs'} eq $k
653 44 1123 unless (length $k)
654 20 24 if (&is_literal_value($v)) { }
680 2 444 if not defined $self->{'_nested_func_lhs'} and &List::Util::first(sub { $op =~ /$_->{'regex'}/; } , @{$$self{'special_ops'};})
682 204 240 if (my $op_entry = &List::Util::first(sub { $op =~ /$_->{'regex'}/xi; } , @{$$self{'unary_ops'};}))
685 204 0 if (not ref $handler) { }
0 0 elsif (ref $handler eq 'CODE') { }
686 9 195 if ($op =~ s/ [_\s]? \d+ $//x)
707 0 207 unless defined $self->{'_nested_func_lhs'}
737 43 27 $op =~ /^or/i ? :
742 0 0 $op =~ /^or/i ? :
750 0 0 $op =~ /^or/i ? :
807 14 10 if $op =~ /^not/i
815 2 6 if (not defined $rhs or length ref $rhs)
824 2 4 $lhs ? :
838 4 8 unless (defined $rhs)
839 4 0 defined $lhs ? :
847 4 4 defined $lhs ? :
852 4 4 $lhs ? :
867 45 1 if (@$v) { }
872 22 23 defined $v[0] && $v[0] =~ /^ - (?: AND|OR ) $/xi ? :
879 22 23 if ($op)
884 22 23 $op ? :
900 151 432 defined $self->{'_nested_func_lhs'} ? :
925 28 13 if (ref $val eq 'HASH' and keys %$val == 1 and exists $val->{'-value'} and not defined $val->{'-value'})
932 1 587 if ($orig_op =~ /^ \- (and|or) $/xi) { }
137 450 elsif (my $special_op = &List::Util::first(sub { $op =~ /$_->{'regex'}/xi; } , @{$$self{'special_ops'};})) { }
938 0 137 if (not $handler) { }
134 3 elsif (not ref $handler) { }
3 0 elsif (ref $handler eq 'CODE') { }
973 32 0 $op =~ /$self->{'not_like_op'}/ ? :
20 32 $op =~ /$self->{'inequality_op'}/ ? :
9 52 $op =~ /$self->{'like_op'}/ ? :
8 61 $op =~ /$self->{'equality_op'}/ ? :
8 69 $op =~ /^not$/i ? :
984 212 0 $self->{'_nested_func_lhs'} eq $k ? :
990 7 554 defined $all_sql && $all_sql ? :
1018 106 43 if (@vals) { }
1021 119 33 defined $_ ? :
1026 2 104 if (defined $vals[0] and $vals[0] =~ /^ - (AND|OR) $/xi)
1034 36 4 if (@vals > 1 and !$logic || $logic eq 'OR' and $op =~ /$self->{'inequality_op'}/xi || $op =~ /$self->{'not_like_op'}/)
1059 24 2 $op =~ /$self->{'not_like_op'}/ ? :
1 26 $op =~ /$self->{'inequality_op'}/ ? :
16 27 $op =~ /$self->{'like_op'}/ ? :
0 43 $op =~ /$self->{'equality_op'}/ ? :
1155 7 28 if @$vals != 2
1173 0 2 if @rest or not $func =~ /^ \- (.+)/x
1204 2 35 if defined $vals and not ref $vals
1212 22 3 if (@$vals) { }
1230 0 1 if @rest or not $func =~ /^ \- (.+)/x
1257 1 2 $op =~ /\bnot\b/i ? :
1295 6 1 if ($inner =~ /\)/)
1306 1 5 if defined $remainder and $remainder =~ /\S/
1331 46 4 @sql ? :
1339 50 0 wantarray ? :
1367 0 40 unless $key
1369 2 38 if (@rest or not $key =~ /^-(desc|asc)/i)
1422 4 1453 unless defined $_[1]
1423 2 1451 if ref $_[1] eq 'SCALAR'
1426 969 482 unless $_[0]{'quote_char'}
1431 0 0 $qref eq 'ARRAY' ? :
482 0 !$qref ? :
1439 0 485 $_ eq '*' ? :
449 33 $_[0]{'name_sep'} ? :
1447 38 1515 if ($_[0]{'convert'})
1458 100 943 $_[0]{'bindtype'} eq 'columns' ? :
1468 30 65 if ($self->{'bindtype'} eq 'columns')
1470 10 21 if (not defined $_ or ref $_ ne 'ARRAY' or @$_ != 2)
1480 358 1064 if (@$clauses_aref > 1) { }
1064 0 elsif (@$clauses_aref) { }
1498 42 2275 $_[0]{'case'} ? :
1509 252 5139 unless defined $data
1512 2 5137 &Scalar::Util::blessed($data) ? :
1514 1974 3165 unless $ref
1519 2 106 &Scalar::Util::blessed($data) ? :
1520 106 2 if $ref
1529 2223 3155 if $try[0] eq 'SCALAR' or $try[0] eq 'UNDEF'
1539 2662 0 if $method = $self->can($meth_prefix . '_' . $_)
1552 2716 810 if $coderef = $dispatch_table->{$_}
1556 0 2716 unless $coderef
1576 0 6 unless ref $data eq 'HASH'
1584 0 1 if ($self->{'array_datatypes'}) { }
1616 0 0 if ($ref eq 'HASH') { }
0 0 elsif ($ref eq 'ARRAY') { }
0 0 elsif ($ref eq 'SCALAR') { }
1621 0 0 if ($r eq 'ARRAY') { }
0 0 elsif ($r eq 'SCALAR') { }
1640 0 0 if ($r eq 'ARRAY') { }
0 0 elsif ($r eq 'SCALAR') { }
1668 0 0 if (wantarray) { }
1672 0 0 ref $d ? :