Branch Coverage

blib/lib/DBIx/Class/SQLMaker/Util.pm
Criterion Covered Total %
branch 144 160 90.0


line true false branch
33 3 102 unless defined $Data::Dumper::Indent
61 105 0 if (&modver_gt_or_eq('Data::Dumper', '2.136'))
64 105 0 if (&modver_gt_or_eq('Data::Dumper', '2.153'))
67 105 0 if (&modver_gt_or_eq('Data::Dumper', '2.160'))
95 272 47290 if (not $where) { }
42096 5194 elsif ($where_is_anded_array or ref $where eq 'HASH') { }
4498 696 elsif (ref $where eq 'ARRAY') { }
102 4759 37337 $where_is_anded_array ? :
106 45321 1368 if (ref $chunk eq 'HASH') { }
511 857 elsif (ref $chunk eq 'ARRAY') { }
454 403 elsif (not length ref $chunk) { }
110 128 49869 unless (length $_)
111 60 68 &is_literal_value($chunk->{$_}) ? :
121 447 64 if @$chunk
127 10 444 if $where_is_anded_array and not defined $chunk && length $chunk
137 330 41688 unless @pairs
139 230 41120 unless my(@conds) = _normalize_cond_unroll_pairs(\@pairs)
144 0 50662 if (ref $c ne 'HASH') { }
151 998 55638 if ($col =~ /^\-and$/i) { }
2028 53610 elsif ($col =~ /^\-/) { }
1580 52030 elsif (exists $fin->{$col}) { }
155 0 0 ref $c->{$col} eq 'HASH' ? :
998 0 ref $c->{$col} eq 'ARRAY' ? :
164 89 3071 ref $_ eq 'ARRAY' && ($_->[0] || '') =~ /^\-and$/i ? :
178 79437 2803 unless $fin->{$op}
315 81925 if (@{[] unless $fin->{$op};} > 1)
194 156 7349 unless defined $where->[$i] and length $where->[$i]
200 1175 6174 if ($logic_mod) { }
4013 2161 elsif (not length ref $where->[$i]) { }
202 0 1175 unless ref $where->[$i] eq 'HASH' or ref $where->[$i] eq 'ARRAY'
205 103 922 unless my $sub_elt = normalize_sqla_condition({$logic_mod, $where->[$i]})
209 369 553 if (@keys == 1 and not $keys[0] =~ /^\-/) { }
217 1 4012 unless my $sub_elt = normalize_sqla_condition({@{$where;}[$i, $i + 1]})
228 580 3584 if (not $fin_idx) { }
2041 1543 elsif (keys %$fin_idx == 1) { }
239 4333 43 if (ref $fin_idx->{$_} eq 'HASH' and keys %{$$fin_idx{$_};} == 1) { }
242 136 4197 if (ref $r eq 'ARRAY' and @$r == 1 && $l =~ /^\-and$/i || $l =~ /^\-or$/i) { }
0 4197 elsif (ref $r eq 'HASH' and keys %$r == 1 and $l =~ /^\-(?:and|or)$/i) { }
288 0 3269 if @$and == 0
291 1832 1437 if (ref $and->[0] eq 'HASH' and not grep({exists $fin->{$_};} keys %{$$and[0];})) { }
308 51393 2671 unless ref $fin->{$col} eq 'ARRAY' and ($fin->{$col}[0] || '') =~ /^\-and$/i
310 978 4352 !length(ref $_) || &is_plain_value($_) ? :
147 5330 !defined($_) ? :
315 348 2323 if (keys %$val_bag == 1) { }
323 45400 0 keys %$fin ? :
334 463 53870 if (not length $lhs) { }
5569 48301 elsif ($lhs =~ /^\-and$/i) { }
2660 45641 elsif ($lhs =~ /^\-or$/i) { }
342 303 2357 ref $rhs eq 'HASH' ? :
346 6 45635 if (ref $rhs eq 'HASH' and not keys %$rhs) { }
11292 34343 elsif (ref $rhs eq 'HASH' and keys %$rhs == 1 and exists $rhs->{'-ident'}) { }
33 34310 elsif (ref $rhs eq 'HASH' and keys %$rhs == 1 and exists $rhs->{'-value'} and &is_plain_value($rhs->{'-value'})) { }
4183 30127 elsif (ref $rhs eq 'HASH' and keys %$rhs == 1 and exists $rhs->{'='}) { }
328 29799 elsif (ref $rhs eq 'ARRAY') { }
25 29774 elsif (ref $rhs eq 'HASH' and (my($subop) = keys %$rhs) == 1 and length ref((values %$rhs)[0]) and my $vref = &is_plain_value(scalar((values %$rhs)[0]))) { }
357 1268 2915 if (length ref $rhs->{'='} and &is_literal_value($rhs->{'='})) { }
364 0 2920 if (keys %$p > 1)
378 2895 25 !length(ref $r) || ref $r eq 'HASH' && keys %$rhs == 1 && exists $rhs->{'='} || &is_plain_value($r) ? :
391 66 262 if (not @$rhs) { }
118 144 elsif (($rhs->[0] || '') =~ /^\-(?:and|or)$/i) { }
15 129 elsif (@$rhs == 1) { }
395 0 118 if @$rhs == 1
398 108 10 if ($rhs->[0] =~ /^\-and$/i) { }
5 5 elsif (@$rhs == 2) { }
426 18 7 length ref $$vref ? :
466 322 9786 if (not defined($v = $where_hash->{$c})) { }
1557 8229 elsif (ref $v eq 'HASH' and keys %$v == 1) { }
6643 1586 elsif (not length ref $v or &is_plain_value($v)) { }
87 1840 elsif (ref $v eq 'ARRAY' and ($v->[0] || '') eq '-and') { }
467 85 237 if $consider_nulls
474 12 1545 if (exists $v->{'-value'}) { }
1409 136 elsif (length ref $v->{'='} and ref $v->{'='} eq 'HASH' && keys %{$$v{'='};} == 1 && exists $v->{'='}{'-ident'} || &is_literal_value($v->{'='})) { }
475 12 0 if (defined $v->{'-value'}) { }
0 0 elsif ($consider_nulls) { }
505 51 147 unless exists $subval->{$c}
510 81 44 !length(ref $subval->{$c}) || &is_plain_value($subval->{$c}) ? :
22 125 !defined($subval->{$c}) ? :
514 8176 1932 if (keys %$vals == 1) { }
60 1872 elsif (keys %$vals > 1) { }
516 8171 5 unless not $consider_nulls and exists $vals->{'UNDEF'}