Branch Coverage

blib/lib/DBIx/Lite/ResultSet.pm
Criterion Covered Total %
branch 68 148 45.9


line true false branch
26 0 120 unless $self->{$_} = delete $params{$_}
36 0 60 if %params
53 8 0 $methname =~ /^(group_by|order_by|from)$/ ? :
54 0 0 if $methname eq 'page' and $new_self->{'pager'}
80 108 146 /^(?:dbix_lite|table|cur_table)$/ ? :
89 10 0 @_ ? :
104 0 0 if grep {!ref($_) eq 'SCALAR';} values %with
107 0 0 %with ? :
119 0 0 unless ($self->{'pager'})
133 13 0 if defined $where
152 0 4 if (not ref $where and my(@pk) = $self->{'table'}->pk)
176 0 19 ref $col eq 'ARRAY' ? :
179 12 0 unless ref $expr or $self->{'from'}
182 7 12 if (ref $expr eq 'SCALAR')
187 0 19 $as ? :
212 4 1 unless ref $col2 or $col2 =~ /\./
217 1 4 ref $col2 ? :
222 1 3 $join->{'join_type'} eq 'inner' ? :
225 0 4 $table_alias ? :
230 0 18 if ($self->{'from'}) { }
237 0 18 if ($self->{'page'} and defined $self->{'rows_per_page'})
243 8 10 if ($self->{'order_by'})
245 0 8 unless ref $self->{'order_by'} eq 'ARRAY'
257 0 18 $self->{'group_by'} ? :
0 18 $self->{'having'} ? :
8 10 $self->{'order_by'} ? :
0 18 $self->{'limit'} ? :
0 18 $self->{'offset'} ? :
0 18 $self->{'for'} ? :
260 0 18 if ($self->{'with'})
265 0 0 if (ref $$def eq 'ARRAY') { }
294 0 7 ref $col eq 'ARRAY' ? :
295 0 7 if (ref $expr eq 'SCALAR') { }
6 1 elsif ($expr eq "$cur_table_prefix.*") { }
304 1 6 if (not $have_scalar_ref || $have_star and my(@pk) = $self->{'cur_table'}->pk)
319 0 5 unless ref $insert_cols eq 'HASH'
321 0 5 if (@{$self->{'joins'};})
325 0 5 if (not %$insert_cols and $self->{'dbix_lite'}->driver_name eq 'Pg')
339 0 5 unless ref $insert_cols eq 'HASH'
348 0 5 unless ref $insert_cols eq 'HASH'
356 0 5 unless $res
359 0 5 if (my $pk = $self->{'table'}->autopk)
362 0 0 unless exists $insert_cols->{$pk}
372 0 1 unless ref $update_cols eq 'HASH'
376 0 1 if ($self->{'cur_table'}{'name'} ne $self->{'table'}{'name'})
378 0 0 unless my(@pk) = $self->{'cur_table'}->pk
379 0 0 unless @pk == 1
400 0 1 unless ref $update_cols eq 'HASH'
409 0 1 unless ref $update_cols eq 'HASH'
422 0 0 unless ref $cols eq 'HASH'
426 0 0 if (not $object = $self->find($cols))
438 0 0 if ($self->{'cur_table'}{'name'} ne $self->{'table'}{'name'})
440 0 0 unless my(@pk) = $self->{'cur_table'}->pk
441 0 0 unless @pk == 1
485 7 0 $row ? :
518 0 0 unless $self->{'sth'}
520 0 0 unless my $row = $self->{'sth'}->fetchrow_hashref
544 2 0 unless $self->{'sth'}
547 1 1 wantarray ? :
552 0 1 unless my $column_name = shift()
578 4 0 if ref $table_name ne 'ARRAY'
584 0 4 if ($options->{'prevent_duplicates'})
586 0 0 if (defined $table_name->[1] and defined $join->{'table'}[1] and $table_name->[1] eq $join->{'table'}[1] or not defined $table_name->[1] and $table_name->[0] eq $join->{'table'}[0])
617 30 0 if ($table_name eq $self->{'table'}{'name'})
618 0 1 if ($op eq 'select' or $op eq 'update' and $driver_name =~ /^(?:MySQL|Pg)$/i or $op eq 'delete' and $driver_name =~ /^Pg$/i)
633 1 0 if ($table_name eq $table_alias) { }
651 0 12 if (not defined $constructor and $package->can('new'))
657 1 11 if (defined $constructor) { }
658 0 1 if (ref $constructor eq 'CODE') { }
670 1 11 if (my $method = $self->{'cur_table'}{'class_storage'}) { }
671 0 1 unless $package->can($method)
674 0 1 if ref $storage ne 'HASH'
689 0 0 unless my $self = shift()
694 0 0 if (my $rel = $self->{'cur_table'}{'has_many'}{$method})