Branch Coverage

lib/DBIx/Oro/Driver/SQLite.pm
Criterion Covered Total %
branch 91 152 59.8


line true false branch
49 24 3 if (not $file or $file eq ':memory:') { }
2 1 elsif (not -e $file) { }
57 0 2 unless (-d $dir)
62 2 0 if (open TOUCH, '>' . $file)
72 27 0 unless exists $self->{'attached'}
79 0 27 if $autocommit
92 6 21 if $self->{'init'} and (ref $self->{'init'} || '') eq 'CODE'
99 6 20 if ($self->created and $import || $cb)
102 0 6 unless ($self->txn(sub { if ($import) { return -1 unless $self->import_sql($import, $import_cb); } ; if ($cb) { local $_ = $self; return &$cb($self); } ; return 1; } ))
107 0 6 if ($import)
108 0 0 unless $self->import_sql($import, $import_cb)
112 6 0 if ($cb)
121 0 0 if (index($self->file, ':') != 0)
139 1 29 defined $self->{'unicode'} ? :
143 30 0 unless $self->{'foreign_keys'}
171 1 27 unless $self->{'created'}
174 0 27 if (defined $self->{'tid'} and $self->{'tid'} != 'threads'->tid) { }
0 27 elsif ($self->{'pid'} != $$) { }
198 0 1 unless $rv
217 5 6 if ($_[-1] and ref $_[-1] and ref $_[-1] eq 'HASH')
222 11 0 if (not $secure) { }
227 7 4 if $rv
240 0 0 if $rv
244 0 0 unless $sec_value
250 0 0 if $rv
253 0 0 unless $sec_value
266 0 938 unless my $table = $self->_table_name(\@_)
269 0 938 unless $_[0]
272 0 938 if ref $_[0] eq 'HASH' and ref $_[1]
275 905 33 if (ref $_[0] eq 'HASH') { }
33 0 elsif (ref $_[0] eq 'ARRAY') { }
284 0 1351 unless ref $key or $key =~ /$DBIx::Oro::KEY_REGEX/
290 0 905 unless @keys
295 0 905 if ($prop and my $oc = $$prop{-'on_conflict'})
296 0 0 if ($oc eq 'replace') { }
0 0 elsif ($oc eq 'ignore') { }
311 902 3 if $rv
319 1 32 unless $_[1]
332 80 7 unless ref $keys[$i]
349 29 3 if (scalar @_ <= $max) { }
361 27 2 if $rv[0]
378 0 28 unless @_
391 0 28 unless $rv_part
395 0 3 unless $self->txn(sub { while (@v_array = splice(@values, 0, $max - 1)) { @v_array = grep($_, @v_array) unless @_; my $sub_sql = $sql . $union . (' UNION ' . $union) x (scalar(@v_array) - 1); my $rv_part = $self->prep_and_exec($sub_sql, [map({@default, @$_;} @v_array)]); return -1 unless $rv_part; $rv += $rv_part; } ; } )
398 3 0 if $rv
417 16 9 if $rv
428 0 9 if ($rv and $type eq 'insert' and ${$self->{'autocommit'};})
432 0 10 wantarray ? :
453 0 4 unless $_[0]
458 1 4 unless $self->prep_and_exec('DETACH ?', [$db_name])
479 2 0 if $_[0] and $_[0] =~ /^[pcnalsx]+$/i
484 3 0 if (@_)
488 0 3 if $_[0] and $_[0] =~ /^[pcnalsx]+$/i
492 3 0 if ($format) { }
502 3 0 if (/[xals]/)
537 14 8 if ($_ eq 'p' or $_ eq 'c' or $_ eq 'n') { }
4 4 elsif ($_ eq 'a' or $_ eq 'l' or $_ eq 's') { }
4 0 elsif ($_ eq 'x') { }
598 3 2 if ($_[0])
602 3 0 if ($_[0] =~ /$arguments/) { }
605 0 8 unless $_ =~ /$arguments/
617 8 7 if defined $snippet{$_}
618 12 3 if $s
628 3 2 if ($snippet[0])
661 0 0 if (not defined $_[0]) { }
0 0 elsif ($_[0] and not $self->{'foreign_keys'}) { }
0 0 elsif (not $_[0] and $self->{'foreign_keys'}) { }
686 5 9 if (not defined $_[0]) { }
696 5 4 if ($num and $num =~ /^\d+/o) { }
4 0 elsif (not $num) { }
697 5 0 if ($num > 1) { }
715 4 0 if (${$self->{'_autocounter'};})
719 4 0 unless ${$self->{'in_txn'};}
736 66 889 if (${$self->{'_autocounter'};})
740 4 62 unless ($auto)
742 4 0 unless ${$self->{'in_txn'};}