Branch Coverage

blib/lib/DBIx/QueryLog.pm
Criterion Covered Total %
branch 93 130 71.5


line true false branch
24 0 23 eval { do { require DBD::mysql; 1 } } ? :
25 0 23 eval { do { require DBD::Pg; 1 } } ? :
26 23 0 eval { do { require DBD::SQLite; 'DBD::SQLite'->VERSION(1.48); 1 } } ? :
27 0 23 $INC{'DBI/PurePerl.pm'} ? :
109 17 36 unless @_ > 1
118 0 15 wantarray ? :
124 0 15 if ($probability and int((rand()) * $probability) % $probability != 0)
130 5 10 if (my $attrs = $$sth{'private_DBIx_QueryLog_attrs'})
134 6 0 if $bind_params
138 0 15 $$dbh{'Driver'}{'Name'} eq 'Pg' ? :
141 2 13 if ($$container{'explain'} or $ENV{'DBIX_QUERYLOG_EXPLAIN'})
145 9 6 unless ($$container{'skip_bind'} || $ENV{'DBIX_QUERYLOG_SKIP_BIND'} and @params)
150 0 15 $wantarray ? :
155 0 15 $wantarray ? :
166 6 0 unless ref $attr eq 'HASH'
184 0 12 if ($probability and int((rand()) * $probability) % $probability != 0)
188 0 12 ref $stmt ? :
191 6 6 if ($$container{'explain'} or $ENV{'DBIX_QUERYLOG_EXPLAIN'})
195 11 1 unless ($$container{'skip_bind'} || $ENV{'DBIX_QUERYLOG_SKIP_BIND'} and @bind)
201 5 7 if ($is_selectrow_array) { }
202 0 5 $wantarray ? :
211 5 7 if ($is_selectrow_array)
212 0 5 $wantarray ? :
222 0 330 wantarray ? :
225 8 322 if ($$dbh{'Driver'}{'Name'} ne 'mysql' and $$dbh{'Driver'}{'Name'} ne 'Pg' and not $$dbh{'Driver'}{'Name'} eq 'SQLite' && 1 && !@bind)
230 176 146 if ($probability and int((rand()) * $probability) % $probability != 0)
237 6 140 if ($$container{'explain'} or $ENV{'DBIX_QUERYLOG_EXPLAIN'})
241 146 0 unless ($$container{'skip_bind'} || $ENV{'DBIX_QUERYLOG_SKIP_BIND'} and @bind)
246 0 146 $wantarray ? :
251 0 146 $wantarray ? :
259 0 14 unless $ret =~ m[ \A # at start of string (?: \s* # white space (?: /\* .*? \*/ )* # /* ... */ \s* # while space )* SELECT \s* # white space .+? # columns \s* # white space FROM \s* # white space ]imsx
278 0 14 if ($$dbh{'Driver'}{'Name'} eq 'mysql' or $$dbh{'Driver'}{'Name'} eq 'Pg') { }
14 0 elsif ($$dbh{'Driver'}{'Name'} eq 'SQLite') { }
294 4 10 unless defined $args{'print'} and $args{'print'}
298 40 0 defined $_ ? :
308 0 180 if ($$dbh{'Driver'}{'Name'} eq 'mysql' or $$dbh{'Driver'}{'Name'} eq 'Pg') { }
311 0 0 if ($1 eq '?') { }
0 0 elsif ($1 eq ')') { }
314 0 0 $pos >= 6 && substr($ret, $pos - 6, 6) =~ /\A[Ll](?:IMIT|imit) \z/ ? :
316 0 0 if ($limit_flag) { }
321 0 0 if (defined $type and $$dbh{'Driver'}{'Name'} eq 'Pg' and $type == 0)
324 0 0 defined $type ? :
343 2 171 unless not $threshold or $time > $threshold
350 171 8 unless ($SKIP_PKG_MAP{$c[0]} or $c[0] =~ /^DB[DI]::/)
357 7 164 if ($$container{'skip_bind'} or $ENV{'DBIX_QUERYLOG_SKIP_BIND'})
359 7 0 if @$bind_params
362 2 169 if ($$container{'compact'} or $ENV{'DBIX_QUERYLOG_COMPACT'})
369 97 187 if (not $quote_char and $s eq ' ' || $s eq "\n" || $s eq "\t" || $s eq "\r") { }
20 167 elsif ($s eq q['] or $s eq '"' or $s eq '`') { }
1 166 elsif (not $before_escape and $quote_char and $s eq '\\') { }
133 33 elsif (not $quote_char) { }
370 51 46 if $skip_space
376 8 12 if (not $quote_char) { }
7 5 elsif (not $before_escape and $s eq $quote_char) { }
390 2 131 if ($s eq '(') { }
4 254 elsif ($s eq ')' || $s eq ',' and substr($buff, -1, 1) eq ' ') { }
405 2 169 if ($$container{'useqq'} or $ENV{'DBIX_QUERYLOG_USEQQ'})
418 2 169 $$container{'show_data_source'} || $ENV{'DBIX_QUERYLOG_SHOW_DATASOURCE'} ? :
1 170 $color ? :
424 3 168 if (my $logger = $$container{'logger'}) { }
425 2 1 $explain ? :
442 11 157 if (ref $OUTPUT eq 'CODE') { }
443 2 9 $explain ? :
458 10 147 $explain ? :
471 1 1 if ((shift())->[0]) { }