Condition Coverage

blib/lib/DBIx/Class/ResultSet.pm
Criterion Covered Total %
condition 256 355 72.1


and 2 conditions

line l !l condition
659 41213 2415 ref $_ eq 'ARRAY' && !@$_ || ref $_ eq 'HASH' && !keys(%$_) and $_ = undef
1462 989 0 not defined $_->[$i] and push @violating_idx, $i and next COL
2303 21265 1 $$rel_info{$_->{'name'}} && (ref $data->[$i][$_->{'pos'}] eq 'ARRAY' || ref $data->[$i][$_->{'pos'}] eq 'HASH' || defined &blessed($data->[$i][$_->{'pos'}]) && $data->[$i][$_->{'pos'}]->isa('DBIx::Class::Row')) && 1
2353 9 7 $rel_info->{$_} && (ref $data->[$i]{$_} eq 'ARRAY' || ref $data->[$i]{$_} eq 'HASH' || defined &blessed($data->[$i]{$_}) && $data->[$i]{$_}->isa('DBIx::Class::Row')) && 1

and 3 conditions

line !l l&&!r l&&r condition
443 3459 8494 0 @_ == 2 and !defined($_[0]) || ref $_[0] ne ''
470 8339 9209 0 not &List::Util::first(sub { not $safe{$_}; } , keys %$call_attrs) and !defined($call_cond) || ref $call_cond eq 'HASH' && !keys(%$call_cond) || ref $call_cond eq 'ARRAY' && !@$call_cond
486 0 9060 8488 $call_attrs and keys %$call_attrs
596 601 1644 0 @$as and not @$sel
1555 89 0 $pref and $attrs->{'_dark_selector'}
611 656 3 5 ref $_ eq 'HASH' and exists $_->{'-as'}
21 0 638 not ref $_ and $_ =~ /^ [^\s\(\)]+ $/x
709 1 0 0 @bind and ref $bind[-1] eq 'HASH'
784 1025 6 379 @_ > 1 && ref $_[$#_] eq 'HASH'
822 1262 8 35 length ref $call_cond->{$key} and my $relinfo = $rsrc->relationship_info($key)
1270 14 21 length ref $call_cond->{$key} and my $relinfo = $rsrc->relationship_info($key) and ref(my $val = delete $call_cond->{$key}) ne 'ARRAY'
845 819 335 8 $self->{'attrs'}{'accessor'} and $self->{'attrs'}{'accessor'} eq 'single'
1171 0 0 0 @_ > 1 && ref $_[$#_] eq 'HASH'
1273 6838 1989 34 not $fetch_all || $attrs->{'order_by'} and $attrs->{'collapse'}
1989 0 34 not $fetch_all || $attrs->{'order_by'} and $attrs->{'collapse'} and my(@pcols) = $rsrc->primary_columns
1314 0 8 11 $attrs->{'order_by'} && $rsrc->schema->storage->_extract_colinfo_of_stable_main_source_order_by_portion($attrs)
1340 7623 0 226 $attrs->{'collapse'} and my $aliastypes = $attrs->{'_last_sqlmaker_alias_map'}
1356 2158 0 6 ref $sel eq 'REF' and ref $$sel eq 'ARRAY'
1365 993 1138 36 $multiplied_selectors->{$sel} and not $attrs->{'as'}[$i] =~ /\./
1393 4548 13 96 !$self->{'_result_inflator'}{'is_core_row'} && $inflator_cref == (require DBIx::Class::ResultClass::HashRefInflator && 'DBIx::Class::ResultClass::HashRefInflator'->can('inflate_result'))
1398 4 0 7491 $self->{'_result_inflator'}{'is_core_row'} and @$rows < 60
1462 989 0 0 not defined $_->[$i] and push @violating_idx, $i
1513 1307 6499 3 not $fetch_all and @$rows > 1
1564 33094 2 0 $self->{'cursor'} and $self->{'cursor'}{'_pos'}
1597 568 41 15 @_ and defined $_[0]
1616 511 24 13 $rows and $rows < $count
1711 525 8 11 ref $sel eq 'HASH' and $sel->{'-as'}
1722 3 0 0 defined $sql_maker->{'quote_char'} and length $sql_maker->{'quote_char'}
1756 39 98 3 $colpiece =~ /\./ and not $colpiece =~ /^$attrs->{'alias'}\./
1906 5 578 18 not $needs_subq and @{$attrs->{'from'};} > 1
2233 0 0 7744 ref $_[0] eq 'ARRAY' && (@{$_[0];} || (return)) && (ref $_[0][0] eq 'HASH' || ref $_[0][0] eq 'ARRAY') && $_[0]
2295 0 21960 0 $$colinfo{$data->[0][$_]} = {'pos', $_, 'name', $data->[0][$_]} and push @$colnames, $data->[0][$_]
2319 5 0 0 defined &blessed($_) and $_->isa('DBIx::Class::Row')
2369 17 0 1 defined &blessed($_) and $_->isa('DBIx::Class::Row')
2605 0 1498 0 &reftype($new) eq 'HASH' and not keys %$new
1498 0 0 &reftype($new) eq 'HASH' and not keys %$new and &blessed($new)
2706 1319 0 0 $extra_checks{'-join'} and ref $attrs->{'from'} eq 'ARRAY'
1319 0 0 $extra_checks{'-join'} and ref $attrs->{'from'} eq 'ARRAY' and @{$attrs->{'from'};} > 1
2802 3 0 1 @_ > 1 && ref $_[$#_] eq 'HASH'
2804 0 2 2 keys %$hash and my $row = $self->find($hash, $attrs)
2971 25 0 5 @_ > 1 && ref $_[$#_] eq 'HASH'
2973 0 23 7 keys %$hash and my $row = $self->find($hash, $attrs)
3037 11 0 4 @_ > 1 && ref $_[$#_] eq 'HASH'
3100 0 0 2 @_ > 1 && ref $_[$#_] eq 'HASH'
3155 2 796 0 defined $data and ref $data ne 'ARRAY'
3439 192 24 0 $attrs->{'from'} and ref $attrs->{'from'} ne 'ARRAY'
3526 8972 36 0 $attrs->{'collapse'} and $attrs->{'distinct'}
3620 672 2 46 $attrs->{'seen_join'} && keys %{$$attrs{'seen_join'};}
3650 352 0 0 defined $attrs->{'collapse'} and not $attrs->{'collapse'}
3710 0 48 325 $t->{'-alias'} and $t->{'-alias'} eq $alias
3985 144 1 1 $to_serialize->{'pager'} and ref $to_serialize->{'pager'}{'total_entries'} eq 'CODE'
4011 1 0 56 ref $self and my $rsrc = $self->result_source

or 2 conditions

line l !l condition
320 21 5 $attrs->{'rows'} ||= 10
323 18429 14654 $attrs->{'alias'} ||= 'me'
1198 0 14 $self->{'attrs'}{'offset'} || 0
1233 13 52 $self->{'all_cache_position'} ||= 0
1383 4652 0 \&DBIx::Class::Row::inflate_result || die(q[No ::Row::inflate_result() - can't happen])
1825 1307 292 $self->_construct_results('fetch_all') || []
2464 0 9 $main_proto ||= {%$rs_data, map({$_, $sl->{$_};} @$colnames)}
2528 16 0 $attrs->{'rows'} ||= 10
2644 2110 7 $eqs->{$_} || ''
3335 720 0 +(+(shift())->{'attrs'} || {})->{'alias'} || 'me'
3597 1587 7421 $attrs->{'from'} ||= [{'-rsrc', $source, '-alias', $self->{'attrs'}{'alias'}, $self->{'attrs'}{'alias'}, $source->from}]
3605 551 169 delete $attrs->{'join'} || {}
3660 36 316 $attrs->{'seen_join'}{'-relation_chain_depth'} || 0
3665 529 0 $j->[0]{'-relation_chain_depth'} || 0
3670 164 475 $p->{$_} ||= {}
3767 1 14 $attrs->{'offset'} || 0

or 3 conditions

line l !l&&r !l&&!r condition
339 1529 31554 0 $attrs->{'result_class'} || $source->result_class
443 1451 7042 1 !defined($_[0]) || ref $_[0] ne ''
460 0 0 1 not defined $_[$i] or ref $_[$i] ne ''
470 161 0 5560 !defined($call_cond) || ref $call_cond eq 'HASH' && !keys(%$call_cond) || ref $call_cond eq 'ARRAY' && !@$call_cond
511 265 2294 65329 exists $old_attrs->{$_} or exists $call_attrs->{$_}
590 1520 162286 0 $attrs->{$key} || ()
596 1644 601 80843 @$as || @$sel
623 12 9 0 $dark_sel_dumper ||= do { require Data::Dumper::Concise; Data::Dumper::Concise::DumperObject()->Indent(0) }
659 0 4783 38845 ref $_ eq 'ARRAY' && !@$_ || ref $_ eq 'HASH' && !keys(%$_)
712 0 1 0 $attr || ()
834 0 0 20 $crosstable or ref $rel_cond ne 'HASH'
884 1863 1154 0 $ci ||= $self->result_source->columns_info
1027 6951 3804 0 $self->{'cursor'} ||= do { my $attrs = $self->_resolved_attrs; $self->result_source->storage->select($attrs->{'from'}, $attrs->{'select'}, $attrs->{'where'}, $attrs) }
1273 1620 5218 2023 $fetch_all || $attrs->{'order_by'}
1329 1624 2456 4772 $did_fetch_all or @{[] unless $rows;}
1331 72 4700 0 $cursor ||= $self->cursor
1344 293 48 82 $aliastypes->{'multiplying'}{$sel_alias} or $aliastypes->{'premultiplied'}{$sel_alias}
1372 3155 4658 0 $self->{'_result_inflator'}{'cref'} ||= do { $self->throw_exception("Inflator $res_class does not provide an inflate_result() method") unless $res_class->can('inflate_result') }
1442 51 163 9 $self->{'_result_inflator'}{'is_hri'} || $self->{'_result_inflator'}{'is_core_row'}
1491 184 26 56 $did_fetch_all || !$attrs->{'collapse'}
1743 0 3 0 $1 || $2 || $3
1751 3 137 0 $sel_index->{$_} || $_
1899 2 3 596 defined $existing_group_by || ref $attrs->{'from'} ne 'ARRAY' || $self->_has_resolved_attr('rows', 'offset')
1920 0 10 571 ref $attrs->{'from'}[0] ne 'HASH' || ref $attrs->{'from'}[0]{$attrs->{'from'}[0]{'-alias'}}
20 10 571 $needs_subq ||= ref $attrs->{'from'}[0] ne 'HASH' || ref $attrs->{'from'}[0]{$attrs->{'from'}[0]{'-alias'}}
1936 30 0 0 $rsrc->_identifying_column_set || $self->throw_exception(sprintf(q[Unable to perform complex resultset %s() without an identifying set of columns on source '%s'], $op, $rsrc->source_name))
1968 2 3 5 $existing_group_by or keys %{{} unless $join_classifications->{'multiplying'};}
2303 3 1 103454 $_->{'is_rel'} ||= $$rel_info{$_->{'name'}} && (ref $data->[$i][$_->{'pos'}] eq 'ARRAY' || ref $data->[$i][$_->{'pos'}] eq 'HASH' || defined &blessed($data->[$i][$_->{'pos'}]) && $data->[$i][$_->{'pos'}]->isa('DBIx::Class::Row')) && 1
2335 0 1 7 $$colinfo{$colnames->[$_]}{'seen_null'} ||= !defined($data->[$i][$_])
2342 127 97 0 $colinfo->{$_} ||= do { $self->throw_exception("Column '${_}' must be present in supplied explicit column list") if $data_start; push @$colnames, $_; +{'pos', $#$colnames, 'name', $_} }
2353 5 7 212 $colinfo->{$_}{'is_rel'} ||= $rel_info->{$_} && (ref $data->[$i]{$_} eq 'ARRAY' || ref $data->[$i]{$_} eq 'HASH' || defined &blessed($data->[$i]{$_}) && $data->[$i]{$_}->isa('DBIx::Class::Row')) && 1
2384 0 1 31 $colinfo->{$_}{'seen_null'} ||= !defined($data->[$i]{$_})
2483 1 9 0 $main_proto_rs ||= $rsrc->resultset->search($main_proto)
2650 2079 1615 8766 $implied_data || ()
3439 0 9 207 $attrs->{'from'} and ref $attrs->{'from'} ne 'ARRAY' or $self->_has_resolved_attr(@force_subq_attrs)
3535 10137 96 16791 $attrs->{$_} or $$attrs{"+$_"}
3565 1451 647 35219 ref $_ || $_ =~ /\./
3600 551 169 8288 $attrs->{'join'} or $attrs->{'prefetch'}
3632 2952 2 0 $attrs->{$attr} || ()
3708 0 36 12 $is_multi ||= !$t->{'-is_single'}
3711 3 7 38 $attrs->{'_main_source_premultiplied'} ||= $is_multi
3715 7 223 95 $attrs->{'_main_source_premultiplied'} or &List::Util::first(sub { not $_->[0]{'-is_single'}; } , @fromlist)
3757 230 146 8631 $attrs->{'collapse'} || grep({$_ =~ /\./;} @{$$attrs{'as'};})
3871 778 16 71 $best_candidate->{'score'} == 0 or exists $seen_keys->{$import_key}
3893 17091 188 0 $hm ||= do { my $hm = 'Hash::Merge'->new; $hm->specify_behavior({'SCALAR', {'SCALAR', sub { my($defl, $defr) = map({defined $_;} @_[0, 1]); if ($defl xor $defr) { return [$defl ? $_[0] : $_[1]]; } elsif (not $defl) { return []; } else { return [$_[0], $_[1]]; } ; } , 'ARRAY', sub { return $_[1] unless defined $_[0]; '???'; return [$_[0], @{$_[1];}]; } , 'HASH', sub { return [] unless defined $_[0] or keys %{$_[1];}; return [$_[1]] unless defined $_[0]; return [$_[0]] unless keys %{$_[1];}; return [$_[0], $_[1]]; } }, 'ARRAY', {'SCALAR', sub { return $_[0] unless defined $_[1]; '???'; return [@{$_[0];}, $_[1]]; } , 'ARRAY', sub { return $_[1] unless my(@ret) = @{$_[0];}; return [@ret, @{$_[1];}]; my(%idx) = map({$_, 1;} @ret); push @ret, grep({not defined $idx{$_};} @{$_[1];}); \@ret; } , 'HASH', sub { return [$_[1]] unless @{$_[0];}; return $_[0] unless keys %{$_[1];}; '???'; return [@{$_[0];}, $_[1]]; } }, 'HASH', {'SCALAR', sub { return [] unless keys %{$_[0];} or defined $_[1]; return [$_[0]] unless defined $_[1]; return [$_[1]] unless keys %{$_[0];}; return [$_[0], $_[1]]; } , 'ARRAY', sub { return [] unless keys %{$_[0];} or @{$_[1];}; return [$_[0]] unless @{$_[1];}; return $_[1] unless keys %{$_[0];}; '???'; return [$_[0], @{$_[1];}]; } , 'HASH', sub { return [] unless keys %{$_[0];} or keys %{$_[1];}; return [$_[0]] unless keys %{$_[1];}; return [$_[1]] unless keys %{$_[0];}; return [$_[0]] if $_[0] eq $_[1]; return [$_[0], $_[1]]; } }}, 'DBIC_RS_ATTR_MERGER'); $hm }
3920 0 869 1 defined $_[0] or keys %{$_[1];}
3948 0 0 0 keys %{$_[0];} or defined $_[1]
3954 0 0 0 keys %{$_[0];} or @{$_[1];}
3961 0 0 0 keys %{$_[0];} or keys %{$_[1];}

xor 4 conditions

line l&&r l&&!r !l&&r !l&&!r condition
662 3925 15474 1447 968 defined $left xor defined $right
3816 270 17 27 10 defined $a xor defined $b
3901 0 0 74 0 $defl xor $defr