Branch Coverage

blib/lib/DBIx/PreQL.pm
Criterion Covered Total %
branch 66 94 70.2


line true false branch
23 2 28 unless not defined $data or ref $data eq 'HASH'
34 18 12 unless defined $w
36 6 6 if ref $w eq 'CODE'
38 5 1 if (ref $w eq 'ARRAY')
51 0 27 unless defined $q and length $q
57 2 25 ref $q eq 'ARRAY' ? :
62 0 161 unless /^(\s*\S+\s+)/
64 27 134 if not $indent or $l < $indent
74 0 154 unless my($pre, $tag, $post, $sql) = $line =~ /^(\s*)(\S+)(\s*)(.*)$/
83 61 93 if ($tag =~ /^([&|])(?![&|])(\S*)$/)
87 61 0 if '' eq $tag
102 56 20 if (defined $$data{$name}) { }
127 0 44 if $negated
130 21 23 if ($found) { }
150 3 151 if '#' eq $tag
156 14 137 if @{$$nph{'missing'};} and $prefix
159 0 137 unless $sql =~ /\S/
181 37 100 if ('&' eq $prefix) { }
10 90 elsif ('|' eq $prefix) { }
184 1 20 unless @{$$nph{'all'};} or @{$$deps{'all'};}
186 11 25 if @{$$deps{'missing'};}
189 1 9 unless @{$$deps{'all'};}
191 4 5 unless @{$$deps{'found'};}
194 0 90 if @{$$deps{'all'};}
196 39 51 if ('*' ne $tag)
197 0 39 if ($known_tags) { }
198 0 0 unless $$known_tags{$tag}++
201 0 39 if $tag =~ /,$/ or grep(($_ eq uc $tag), ('SELECT', 'FROM', 'LEFT', 'RIGHT', 'INNER', 'OUTER', 'JOIN', 'USING', 'ON', 'WHERE', 'AND', 'OR', 'ORDER', 'GROUP', 'BY', 'LIMIT', 'OFFSET', 'HAVING', 'UNION', 'ALL', 'DISTINCT', 'INSERT', 'UPDATE', 'ALTER', 'CREATE', 'DROP', 'WITH', 'OVER', 'BETWEEN'))
212 1 38 unless $want
215 12 26 unless &$want($tag, $data)
220 2 105 if @{$$nph{'missing'};}
259 0 50 if $type and _is_null($type)
263 0 50 unless exists $NPH_HANDLER{$sigil} and exists $NPH_HANDLER{$sigil}{$type}
281 0 21 $1 && !$2 && length $3 ? :
291 0 50 unless my $np = _process_named_placeholder($sigil, $name, $value)
305 0 27 if $class ne 'DBIx::PreQL'
317 0 27 if @unexpected_keys
325 44 105 unless my($line, $context) = _select_line($_, $indent, $data, $want, $known_tags)
333 7 98 if @query and $line =~ /^\s*FROM\b/i
337 8 97 if @query and $query[-1] =~ /\bWHERE\s*$/i
346 17 5 unless ($keep_keys)
351 0 22 if ($known_tags)
353 0 0 if @unused
363 0 0 if not ref $val or overload::Method($val, '""')
372 0 0 unless _is_ref($val)
375 0 0 unless defined $isa
383 0 0 if _is_a($val, 'SCALAR') and $$val =~ /^\s*NULL\s*$/i