Condition Coverage

blib/lib/DBIx/Class/Storage/DBIHacks.pm
Criterion Covered Total %
condition 226 292 77.4


and 3 conditions

line !l l&&!r l&&r condition
38 0 0 949 ref $attrs->{'from'} eq 'ARRAY' and @{$attrs->{'from'};} > 1
0 0 949 ref $attrs->{'from'} eq 'ARRAY' and @{$attrs->{'from'};} > 1 and ref $attrs->{'from'}[0] eq 'HASH'
0 0 949 ref $attrs->{'from'} eq 'ARRAY' and @{$attrs->{'from'};} > 1 and ref $attrs->{'from'}[0] eq 'HASH' and ref $attrs->{'from'}[1] eq 'ARRAY'
0 57 892 ref $attrs->{'from'} eq 'ARRAY' and @{$attrs->{'from'};} > 1 and ref $attrs->{'from'}[0] eq 'HASH' and ref $attrs->{'from'}[1] eq 'ARRAY' and $self->_use_join_optimizer
106 0 0 87 ref $attrs->{'from'} eq 'ARRAY' and @{$attrs->{'from'};} > 1
0 0 87 ref $attrs->{'from'} eq 'ARRAY' and @{$attrs->{'from'};} > 1 and ref $attrs->{'from'}[0] eq 'HASH'
0 0 87 ref $attrs->{'from'} eq 'ARRAY' and @{$attrs->{'from'};} > 1 and ref $attrs->{'from'}[0] eq 'HASH' and ref $attrs->{'from'}[1] eq 'ARRAY'
134 0 0 20 ref $node eq 'ARRAY' && ref $node->[0] eq 'HASH'
139 20 0 87 ($h->{'-alias'} || '') eq $root_alias and $h->{'-rsrc'}
157 27 295 432 $colinfo->{$sel} and $colinfo->{$sel}{'-source_alias'} ne $root_alias
160 10 0 295 not ref $sel and my $ci = $colinfo->{$sel}
186 236 282 37 $ci->{'-source_alias'} eq $root_alias and not $$selected_root_columns{$ci->{'-colname'}}++
213 42 37 8 grep {$_ ne $root_alias;} keys %{{} unless $inner_aliastypes->{'multiplying'};} and !$inner_aliastypes->{'grouping'} || $inner_attrs->{'_grouped_by_distinct'}
326 80 4 2 $may_need_outer_group_by and $attrs->{'_grouped_by_distinct'}
377 1030 945 897 ref $node eq 'ARRAY' and not $j->{'-is_single'}
408 995 0 125 defined $sql_maker->{'quote_char'} and length $sql_maker->{'quote_char'}
447 10204 0 0 ref $_ eq 'ARRAY' and @$_ == 0 || @$_ == 2
477 9519 0 655 $colinfo->{$piece} and my $alias = $colinfo->{$piece}{'-source_alias'}
529 1837 1 1034 $j->{'-join_type'} and $j->{'-join_type'} =~ /^left (?: \s+ outer)? $/xi
556 17 382 0 $colinfos->{$_} and not $_ =~ /\./
586 163 2 1 not $chunk_ci = $$colinfos{$order_by[$o_idx][0]} and $attrs->{'_aliastypes'}
612 14 33 28 $group_already_unique and not $aliastypes->{'multiplying'}{$chunk_ci->{'-source_alias'}}
47 12 16 $group_already_unique and not $aliastypes->{'multiplying'}{$chunk_ci->{'-source_alias'}} and not $aliastypes->{'premultiplied'}{$chunk_ci->{'-source_alias'}}
686 8136 0 0 &blessed($ident) and $ident->isa('DBIx::Class::ResultSource')
697 8269 0 3137 ref $_ eq 'ARRAY' and ref $_->[0] eq 'HASH'
719 8106 30 0 $colnames and not @$colnames
746 18 5909 103757 $seen_cols{$colname} and @{$seen_cols{$colname};} == 1
971 0 1 25 $colinfos->{$_} && $colinfos->{$_}{'-source_alias'} eq $attrs->{'alias'}
1027 0 432 10 $where_is_anded_array and !defined($chunk) || $chunk eq ''
1064 3098 18 80 ref $_ eq 'ARRAY' && ($_->[0] || '') =~ /^\-and$/i
1083 68 88 5520 defined $where->[$i] and length $where->[$i]
1098 206 343 369 @keys == 1 and not $keys[0] =~ /^\-/
1128 0 16 3244 ref $fin_idx->{$_} eq 'HASH' and keys %{$$fin_idx{$_};} == 1
1131 3122 0 122 ref $r eq 'ARRAY' and @$r == 1 && $l =~ /^\-and$/i || $l =~ /^\-or$/i
2500 0 622 ref $r eq 'HASH' and keys %$r == 1
2500 622 0 ref $r eq 'HASH' and keys %$r == 1 and $l =~ /^\-(?:and|or)$/i
1171 27046 366 2137 $fin->{'-and'} and @{$fin->{'-and'};} < 2
1180 758 0 1379 ref $and->[0] eq 'HASH' and not grep({exists $fin->{$_};} keys %{$$and[0];})
1197 34851 118 2652 ref $fin->{$col} eq 'ARRAY' and ($fin->{$col}[0] || '') =~ /^\-and$/i
1235 22329 5646 6 ref $rhs eq 'HASH' and not keys %$rhs
22329 22 5624 ref $rhs eq 'HASH' and keys %$rhs == 1
22351 5624 0 ref $rhs eq 'HASH' and keys %$rhs == 1 and exists $rhs->{'-ident'}
22329 22 5302 ref $rhs eq 'HASH' and keys %$rhs == 1
22351 5251 51 ref $rhs eq 'HASH' and keys %$rhs == 1 and exists $rhs->{'-value'}
5251 18 33 ref $rhs eq 'HASH' and keys %$rhs == 1 and exists $rhs->{'-value'} and &is_plain_value($rhs->{'-value'})
22329 22 5269 ref $rhs eq 'HASH' and keys %$rhs == 1
22351 5269 0 ref $rhs eq 'HASH' and keys %$rhs == 1 and exists $rhs->{'='}
22063 22 3809 ref $rhs eq 'HASH' and (my($subop) = keys %$rhs) == 1
22085 3074 735 ref $rhs eq 'HASH' and (my($subop) = keys %$rhs) == 1 and length ref((values %$rhs)[0])
3096 728 7 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]))
1246 474 290 696 length ref $rhs->{'='} and &is_literal_value($rhs->{'='})
1352 11967 22 477 ref $v eq 'HASH' and keys %$v == 1
88 598 81 ref $v eq 'ARRAY' and ($v->[0] || '') eq '-and'
1360 86 379 0 length ref $v->{'='} and ref $v->{'='} eq 'HASH' && keys %{$$v{'='};} == 1 && exists $v->{'='}{'-ident'} || &is_literal_value($v->{'='})
1402 7324 4414 5 not $consider_nulls and exists $vals->{'UNDEF'}

or 2 conditions

line l !l condition
139 107 0 $h->{'-alias'} || ''
232 0 0 $inner_select_with_extras ||= [@{$inner_attrs->{'select'};}]
377 897 0 $j->{'-join_path'} || []
0 897 $aliases_by_type->{'multiplying'}{$al} ||= {'-parents', $j->{'-join_path'} || []}
384 369 0 $j->{'-join_path'} || []
0 369 $aliases_by_type->{'premultiplied'}{$al} ||= {'-parents', $j->{'-join_path'} || []}
478 265 249 $alias_list->{$alias}{'-join_path'} || []
141 514 $aliases_by_type->{$type}{$alias} ||= {'-parents', $alias_list->{$alias}{'-join_path'} || []}
496 3039 2079 $alias_list->{$alias}{'-join_path'} || []
3860 5118 $aliases_by_type->{$type}{$alias} ||= {'-parents', $alias_list->{$alias}{'-join_path'} || []}
515 39 178 $alias_list->{$alias}{'-join_path'} || []
1317 217 $aliases_by_type->{$type}{$alias} ||= {'-parents', $alias_list->{$alias}{'-join_path'} || []}
529 644 567 $j->{'-join_path'} || []
627 1211 $aliases_by_type->{'restricting'}{$alias} ||= {'-parents', $j->{'-join_path'} || []}
639 13 46 $order_chunks ||= [map({ref $_ eq 'ARRAY' ? $_ : [$_];} $sql_maker->_order_by_chunks($attrs->{'order_by'}))]
664 59 86 $new_order_by[$_] ||= \$order_chunks->[$_]
737 30 8106 $colnames ||= [@auto_colnames, grep({@{$seen_cols{$_};} == 1;} keys %seen_cols)]
837 270 0 $from->[$i][0]{'-alias'} || ''
1087 1153 4367 ($where->[$i] =~ /^(\-(?:and|or))$/i)[0] || ''
1113 764 575 $self->_collapse_cond($where->[$i]) || (next)
1197 2706 64 $fin->{$col}[0] || ''
1281 201 5 $rhs->[0] || ''
1352 313 366 $v->[0] || ''

or 3 conditions

line l !l&&r !l&&!r condition
54 104 118 670 $attrs->{'_force_prune_multiplying_joins'} or $attrs->{'group_by'}
77 4 1389 129 not defined $j->[0]{'-alias'} or $need_joins{$j->[0]{'-alias'}}
123 4 11 72 delete $inner_attrs->{'_order_is_artificial'} or not $inner_attrs->{'rows'}
161 10 7 0 $sel->{'-as'} ||= $attrs->{'as'}[$i]
162 17 0 0 $sel->{'-as'} || "inner_column_$i"
213 32 7 6 !$inner_aliastypes->{'grouping'} || $inner_attrs->{'_grouped_by_distinct'}
318 0 6 2 $may_need_outer_group_by ||= $outer_aliastypes->{'multiplying'}{$alias} ? 1 : 0
447 0 0 0 @$_ == 0 || @$_ == 2
459 0 10204 not defined $_ or ref $_ eq 'ARRAY' and @$_ == 0 || @$_ == 2
553 382 17 14 not ref $_ or ref $_ ne 'HASH'
586 0 3 163 @{$order_by[$o_idx];} != 1 or not $chunk_ci = $$colinfos{$order_by[$o_idx][0]} and $attrs->{'_aliastypes'}
609 28 8 0 $attrs->{'_aliastypes'} || $self->_resolve_aliastypes_from_select_args({'from', $attrs->{'from'}, 'order_by', $attrs->{'order_by'}})
25 36 0 $aliastypes ||= $attrs->{'_aliastypes'} || $self->_resolve_aliastypes_from_select_args({'from', $attrs->{'from'}, 'order_by', $attrs->{'order_by'}})
636 13 46 0 $sql_maker ||= $self->sql_maker
746 51857 51900 0 $source_alias ||= $seen_cols{$colname}[0]
755 98298 11368 0 $colinfos->{$source_alias} ||= $rsrc->columns_info
831 0 0 259 ref $from ne 'ARRAY' or ref $from->[0] ne 'HASH'
0 0 259 ref $from ne 'ARRAY' or ref $from->[0] ne 'HASH' or not defined $from->[0]{'-alias'}
995 4493 21733 3766 $where_is_anded_array or ref $where eq 'HASH'
1027 5 5 432 !defined($chunk) || $chunk eq ''
1091 862 291 0 ref $where->[$i] eq 'HASH' or ref $where->[$i] eq 'ARRAY'
1131 108 14 0 @$r == 1 && $l =~ /^\-and$/i || $l =~ /^\-or$/i
1199 963 0 4304 !length(ref $_) || &is_plain_value($_)
1268 235 12 20 !length(ref $r) || ref $r eq 'HASH' && keys %$rhs == 1 && exists $rhs->{'='} || &is_plain_value($r)
1352 11199 23 767 not length ref $v or &is_plain_value($v)
1360 89 285 5 ref $v->{'='} eq 'HASH' && keys %{$$v{'='};} == 1 && exists $v->{'='}{'-ident'} || &is_literal_value($v->{'='})
1396 79 0 34 !length(ref $subval->{$c}) || &is_plain_value($subval->{$c})