Branch Coverage

blib/lib/Data/Model/SQL.pm
Criterion Covered Total %
branch 76 96 79.1


line true false branch
15 3986 698 unless @_ > 1
17 683 15 @_ == 1 && ref $_[0] eq 'ARRAY' ? :
24 3434 1113 unless @_ > 1
26 1104 9 @_ == 1 && ref $_[0] eq 'ARRAY' ? :
34 3588 1132 unless ($self->$name and ref $self->$name eq 'ARRAY')
35 0 3588 $self->$name ? :
39 1770 0 unless $self->$name and ref $self->$name eq 'HASH'
45 89 501 if (exists $args{'where'})
47 89 0 if (ref $args{'where'} eq 'ARRAY') { }
0 0 elsif (ref $args{'where'} eq 'HASH') { }
65 0 590 if (exists $args{'where_sql'})
67 0 0 if (ref $args{'where_sql'} eq 'ARRAY') { }
0 0 elsif (ref $args{'where_sql'} eq 'HASH') { }
113 3 7 unless $col
120 4 1 ref $joins eq 'ARRAY' ? :
128 26 625 if (lc $col eq '-and' or lc $col eq '-or') { }
129 12 14 lc $col eq '-and' ? :
142 0 625 unless $col =~ /^[\w\.]+$/ or ref $col eq 'SCALAR'
158 624 1 if defined $tcol
181 1 0 if (my $orig = $stmt->select_map_reverse->{$col})
194 461 76 if (@{$self->select;})
198 2 5 /(?:^|\.)\Q$alias\E$/ ? :
7 1059 $alias ? :
208 5 532 if ($self->joins and @{$self->joins;})
212 5 3 unless $initial_table_written++
216 9 0 if (ref $target eq 'HASH')
222 9 0 if $condition
225 1 4 if @{$self->from;}
232 551 48 if ($self->where and @{$self->where;})
240 1 536 if ($self->having and @{$self->having;})
248 529 8 unless my $n = $self->limit
249 1 7 if $n =~ /\D/
250 3 4 $self->offset ? :
256 0 1074 unless my $attribute = $self->$set
261 5 137 if (not $ref) { }
137 0 elsif ($ref eq 'HASH') { }
269 985 89 unless @sqls
298 1 646 if (ref $col eq 'SCALAR') { }
29 617 elsif (ref $val eq 'ARRAY') { }
50 567 elsif (ref $val eq 'HASH') { }
1 566 elsif (ref $val eq 'SCALAR') { }
302 8 21 if (ref $$val[0] or ($$val[0] || '') eq '-and') { }
305 7 1 if ($$val[0] eq '-and')
318 0 21 if $m = $self->column_mutator
323 0 50 if $m = $self->column_mutator
325 12 38 if (uc $op eq 'IN' || uc $op eq 'NOT IN' and ref $v eq 'ARRAY') { }
333 0 1 if $m = $self->column_mutator
336 0 566 if $m = $self->column_mutator