Branch Coverage

blib/lib/DBIx/DataModel/Statement.pm
Criterion Covered Total %
branch 144 192 75.0


line true false branch
69 0 192 unless $source and $source->isa("DBIx::DataModel::Source")
85 33 159 if %other_args
134 0 14 unless $self->status >= "sqlized"
138 13 1 wantarray ? :
146 171 23 if (@args == 1) { }
1 22 elsif (@args == 3) { }
0 22 elsif (@args % 2 == 1) { }
147 171 0 if (&does($args[0], 'HASH')) { }
0 0 elsif (&does($args[0], 'ARRAY')) { }
167 27 167 if ($self->status < 3) { }
174 22 32 unless my $indices = $self->{'param_indices'}{$k}
192 0 131 unless $self->status <= "refined"
200 4 195 if $k eq "-with"
203 0 199 unless my $refine_handler = $REFINABLE_ARGS{$k}
216 0 164 unless $self->status < "sqlized"
220 1 163 if @args
229 2 162 if $source_where
238 1 163 if $result_as eq "firstrow" and $self->schema->autolimit_firstrow
242 161 3 if ($result_as ne "subquery")
243 2 159 if ($args->{'-for'}) { }
159 0 elsif (not exists $args->{'-for'}) { }
252 6 158 if (my $where_on = $args->{'-where_on'})
255 1 5 unless &does($sqla_args{'-from'}, "ARRAY")
260 0 5 unless $join_op eq "-join"
271 1 8 unless my $join_cond = $by_dest_table{$db_table} || $by_dest_table{$table}
281 51 111 if (&does($sqla_args{'-from'}, "ARRAY"))
282 0 51 unless $sqla_args{'-from'}[0] eq "-join"
286 3 48 exists $args->{'-join_with_USING'} ? :
289 5 79 if ($join_with_USING) { }
290 5 0 if $join_cond->{'using'}
302 0 162 if ($args->{'-post_SQL'})
313 162 0 if (my $regex = $self->{'placeholder_regex'})
316 32 146 if $self->{'bound_params'}[$i] =~ /$regex/
319 162 0 if $self->{'pre_bound_params'}
327 0 162 if $callback
340 156 0 if @args or $self->status < "sqlized"
342 0 154 unless $self->status == "sqlized"
349 0 154 unless my $dbh = $self->schema->dbh
352 0 154 if (my $prepare_attrs = $self->{'args'}{'-prepare_attrs'})
369 0 535 if $self->status < "prepared"
379 151 5 if $self->status < "prepared"
382 5 142 if @bind_args
394 4 143 if $args->{'-pre_exec'}
398 115 64 unless $self->{'param_indices'}
399 0 32 unless exists $self->{'bound_params'}[$indices->[0]]
402 0 147 if @unbound
410 4 143 if $args->{'-post_exec'}
421 154 10 if @_
425 0 151 &does($arg_result_as, 'HASH') ? :
11 151 &does($arg_result_as, 'ARRAY') ? :
436 0 161 unless my $result_class = $self->schema->metadm->find_result_class($result_as)
446 6 0 unless (exists $self->{'row_count'})
447 1 5 if $self->status < "sqlized"
455 2 4 if ($limit_sql =~ /ROWNUM/) { }
3 1 elsif ($sql =~ s/\b$limit_sql//i) { }
458 1 1 if ($sql =~ s/^$limit_sql/$1/)
476 2 4 if $should_wrap
483 0 6 unless my $dbh = $self->schema->dbh
504 128 71 if $self->status < "executed"
506 0 190 unless my $sth = $self->sth
507 0 190 unless my $callback = $self->{'row_callback'}
509 85 105 if (not defined $n_rows) { }
512 25 10 $sth->fetch ? :
35 50 $self->{'reuse_row'} ? :
513 51 34 if ($row)
520 0 105 unless $n_rows > 0
521 0 105 if $self->{'reuse_row'}
524 105 111 unless my $row = $sth->fetchrow_hashref
544 144 2 unless +(shift())->{'args'}{'-page_size'}
545 144 2 unless +(shift())->{'args'}{'-page_index'}
550 147 144 unless (exists $self->{'offset'})
553 1 146 exists $self->{'args'}{'-offset'} ? :
564 0 0 unless my $row_count = $self->row_count
594 1 182 unless $schema->{'is_singleton'} and not $schema->{'db_schema'}
599 65 118 unless $self->{'from_DB_handlers'}
603 17 240 if exists $row->{$column_name}
613 0 22 unless $self->status == "executed"
633 0 2 unless exists $self->{'nb_fetched_rows'}
644 0 11 unless $self->status == "executed"
673 10 4 ref $v ? :
676 0 14 unless @pk_columns
677 0 14 unless @pk_columns == @$primary_key
680 2 12 unless &List::MoreUtils::all(sub { defined $_; } , @$primary_key)
696 55 19 &does($v, 'ARRAY') ? :
697 0 74 if (my $old_cols = $self->{'args'}{'-columns'})
698 0 0 unless (@$old_cols == 1 and $old_cols->[0] eq "*")
700 0 0 unless &any(sub { $_ eq $col; } , @$old_cols)
722 0 6 if ($callbacks)
745 21 65 unless $self->{'aliased_columns'}
747 9 12 if $column =~ s/^([^()]+) # supposed table name (without parens) \. # followed by a dot (?=[^()]+$) # followed by supposed col name (without parens) //x
752 12 9 if (not $table_name) { }
762 0 9 unless my $table = $meta_schema->table($table_name) || &firstval(sub { ($_->{'db_name'} || '') eq $table_name; } , $meta_source, $meta_source->ancestors) || &firstval(sub { uc($_->{'db_name'} || '') eq uc $table_name; } , $meta_source, $meta_source->ancestors)
770 1 64 if (my $col_types = $self->{'args'}{'-column_types'})
772 0 1 unless &does($columns, "ARRAY")
773 0 1 unless my $type = $self->schema->metadm->type($type_name)
782 48 113 unless my $from_DB_handler = $col_handlers->{'from_DB'}