Branch Coverage

File:blib/lib/Database/Abstraction.pm
Coverage:55.6%

line%coveragebranch
197100TFif (my $params = Params::Get::get_params(undef, @_))
198100TFif ($$params{"expires_in"} and not $$params{"cache_duration"})
22650TFif (scalar(@_) % 2 == 0) { }
0TFelsif (scalar @_ == 1 and ref $_[0] eq 'HASH') { }
0TFelsif (scalar @_ > 0) { }
322100TFif (scalar @_ == 1 and not ref $_[0]) { }
100TFelsif (my $params = Params::Get::get_params(undef, @_)) { }
32850TFif (not defined $class) { }
100TFelsif ($class eq __PACKAGE__) { }
100TFelsif (&Scalar::Util::blessed($class)) { }
3290TFif (scalar keys %args > 0)
34750TFif (defined $args{"logger"})
34850TFunless (&Scalar::Util::blessed($args{"logger"}) and $args{"logger"}->can("info") and $args{"logger"}->can("error"))
353100TFunless $args{"directory"} or $defaults{"directory"}
355100TFunless -d ($args{'directory'} || $defaults{'directory'})
39550TFif (my $logger = $$params{"logger"})
396100TFif (&Scalar::Util::blessed($logger)) { }
41250TFunless (UNIVERSAL::isa((&CORE::GLOBAL::caller())[0], __PACKAGE__))
419100TF$$self{'sep_char'} ? :
42750TFif $$self{$table}
43950TFif (-r $slurp_file)
4410TFunless "DBI"->can("connect")
44750TFif ($dbh) { }
50TFelsif ($self->_is_berkeley_db('File::Spec'->catfile($dir, "$dbname.db"))) { }
46250TFif (defined $slurp_file and -r $slurp_file) { }
473100TFif (defined $fin) { }
481100TFif (my $filename = $$self{'filename'} || $defaults{'filename'})
485100TFif (defined $slurp_file and -r $slurp_file) { }
486100TFif defined $fin
491100TFif ($$params{'column_names'}) { }
556100TFif (-s $slurp_file <= $max_slurp_size and not $$params{"column_names"})
55750TFif (-s $slurp_file == 0) { }
583100TFif ($$self{'no_entry'}) { }
600100TFif (-r $slurp_file) { }
601100TFif (-s $slurp_file <= $max_slurp_size) { }
60950TFif (ref $$xml{$key} eq 'ARRAY') { }
0TFelsif (ref $xml eq 'ARRAY') { }
0TFelsif (ref $xml eq 'HASH' and not $$self{'no_entry'}) { }
6140TFif (scalar keys %{$xml;} == 1) { }
6150TFif ($$xml{$table}) { }
62750TFif ($$self{'no_entry'}) { }
65350TFif $$self{"data"} and ref($$self{"data"} eq "HASH")
680100TFif ($$self{'no_entry'}) { }
100TFelsif (scalar @_) { }
68650TFif ($$self{"berkeley"})
692100TFif ($$self{"data"})
693100TFif (scalar keys %{$params;} == 0) { }
100TFelsif (scalar keys %{$params;} == 1 and defined $$params{'entry'} and not $$self{'no_entry'}) { }
69550TFif (ref $$self{"data"} eq "HASH")
70750TFif (scalar keys %{$$self{"data"};} <= 10)
727100TFif ($$self{'type'} eq 'CSV' and not $$self{'no_entry'}) { }
73750TFif (ref $arg)
74150TFunless (defined $arg)
75050TFif ($done_where) { }
75650TFif ($arg =~ /[%_]/) { }
763100TFunless ($$self{"no_entry"})
767100TFif (defined $query_args[0]) { }
77550TFif ($c = $$self{'cache'}) { }
7770TFif (defined $query_args[0])
7800TFif (my $rc = $c->get($key))
79450TFif (my $sth = $$self{$table}->prepare($query))
79550TFunless $sth->execute(@query_args)
80150TFif scalar keys %{$href;}
80350TFif ($c)
80750TFunless $$self{"no_fixate"}
85050TFif ($$self{"berkeley"})
857100TFif ($$self{"data"})
858100TFif (scalar keys %{$params;} == 0) { }
50TFelsif (scalar keys %{$params;} == 1 and defined $$params{'entry'} and not $$self{'no_entry'}) { }
86050TFif (ref $$self{"data"} eq "HASH")
874100TFif ($$self{'type'} eq 'CSV' and not $$self{'no_entry'}) { }
88450TFif (ref $arg)
888100TFunless (defined $arg)
897100TFif ($done_where) { }
90350TFif ($arg =~ /[%_]/) { }
910100TFunless ($$self{"no_entry"})
91350TFunless (wantarray)
917100TFif (defined $query_args[0]) { }
92550TFif ($c = $$self{'cache'}) { }
9270TFif (wantarray)
9300TFif (defined $query_args[0])
9330TFif (my $rc = $c->get($key))
9350TFwantarray ? :
94750TFif (my $sth = $$self{$table}->prepare($query))
94850TFunless $sth->execute(@query_args)
95450TFunless wantarray
95750TFif ($c)
96150TFif ($rc)
96250TFunless $$self{"no_fixate"}
99450TFif ($$self{"berkeley"})
1001100TFif ($$self{"data"})
1002100TFif (scalar keys %{$params;} == 0) { }
50TFelsif (scalar keys %{$params;} == 1 and defined $$params{'entry'} and not $$self{'no_entry'}) { }
100450TFif (ref $$self{"data"} eq "HASH")
10090TF$$self{'data'}{$$params{'entry'}} ? :
1016100TFif ($$self{'type'} eq 'CSV' and not $$self{'no_entry'}) { }
50TFelsif ($$self{'no_entry'}) { }
102850TFif (ref $arg)
103250TFunless (defined $arg)
104150TFif ($done_where) { }
104750TFif ($arg =~ /[%_]/) { }
1054100TFunless ($$self{"no_entry"})
1058100TFif (defined $query_args[0]) { }
106650TFif ($c = $$self{'cache'}) { }
10700TFif (defined $query_args[0])
10730TFif (my $rc = $c->get($key))
108350TFif (my $sth = $$self{$table}->prepare($query))
108450TFunless $sth->execute(@query_args)
1117100TFif (not $$self{'no_entry'}) { }
1126100TFif ($$self{"data"} and not $$self{"no_entry"} and scalar keys %{$params;} == 1 and defined $$params{"entry"})
113150TFif ($$self{"berkeley"})
11340TFif (not $$self{"no_entry"} and scalar keys %{$params;} == 1 and defined $$params{"entry"})
11380TFif ($$self{"no_entry"} and scalar keys %{$params;} == 1 and defined $id and defined $$params{$id})
11390TFif (my $rc = $$self{"berkeley"}{$$params{$id}})
114850TFif (my $t = delete $params->{'table'}) { }
1155100TFif ($$self{"type"} eq "CSV" and not $$self{"no_entry"})
1161100TFif (my $arg = $$params{$c1}) { }
50TFelsif (not defined $arg) { }
116450TFif (ref $arg)
1169100TFif ($done_where) { }
117550TFif ($arg =~ /[%_]/) { }
119150TFif (defined $query_args[0]) { }
119950TFif (defined $query_args[0]) { }
120050TFif (wantarray)
120850TFif ($c = $$self{"cache"})
12090TFif (my $rc = $c->get($key))
12100TFif (wantarray) { }
12110TFif (ref $rc eq "ARRAY")
122050TFunless my $sth = $$self{$table}->prepare($query)
122250TFunless $sth->execute(@query_args)
122450TFif ($c)
12250TFif ($rc) { }
125550TFif ($$self{"berkeley"})
126250TFunless defined $$args{"query"}
126950TFunless $query =~ /\sFROM\s/i
127650TFunless $sth->execute
128250TFunless wantarray
132950TFif $column eq "DESTROY"
133150TFunless my $self = shift()
133350TFunless ref $self
133650TFif exists $self->{'auto_load'} and &boolean($$self{"auto_load"})->isFalse
133950TFunless $column =~ /^[a-zA-Z_][a-zA-Z0-9_]*$/
1344100TFif (ref $_[0] eq 'HASH') { }
100TFelsif (scalar(@_) % 2 == 0) { }
50TFelsif (scalar @_ == 1) { }
135050TFif ($$self{"no_entry"} and not $$self{"berkeley"})
135650TFif ($$self{"berkeley"})
13570TFif (my $id = $$self{"id"})
136350TFunless defined $$self{"type"}
1368100TFif (wantarray and not $distinct) { }
1369100TFif (scalar keys %params == 0 and my $data = $$self{"data"})
1373100TFif ($$self{'type'} eq 'CSV' and not $$self{'no_entry'}) { }
1380100TFif (my $data = $$self{"data"})
138450TFif ($$self{'no_entry'}) { }
100TFelsif (scalar keys %params == 1 and defined(my $key = $params{'entry'})) { }
100TFelsif (scalar keys %params == 0) { }
13870TFif (defined $key)
13900TFif (defined $$row{$key} and $$row{$key} eq $value and my $rc = $$row{$column})
13910TFif (defined $rc) { }
1408100TFif (defined(my $hash = $$data{$key}))
1410100TFunless (exists $hash->{$column})
1415100TFif (defined $rc) { }
142250TFif (wantarray)
142350TFif ($distinct)
1438100TFif (defined $$row{$key} and $$row{$key} eq $value and my $rc = $$row{$column})
143950TFif (defined $rc) { }
145150TFif ($$self{'type'} eq 'CSV' and not $$self{'no_entry'}) { }
146150TFif (defined $value) { }
1462100TFif ($done_where) { }
14710TFif ($done_where) { }
1479100TFif (wantarray) { }
1484100TFif (scalar @args and $args[0]) { }
149150TFif ($cache = $$self{'cache'}) { }
14920TFif (wantarray)
14950TFif (defined $args[0]) { }
15000TFif (my $rc = $cache->get($key))
15020TFwantarray ? :
151150TFunless $sth->execute(@args)
1513100TFif (wantarray)
151550TFif ($cache)
151850TFunless $$self{"no_fixate"}
152350TFif ($cache)
153150TFif (defined $^V and $^V ge "v5.14.0")
153250TFif ${^GLOBAL_PHASE} eq "DESTRUCT"
153750TFif ($$self{"temp"})
1545100TFif (my $dbh = delete $self->{$table_name})
154650TFif $dbh->can("disconnect")
154750TFif $dbh->can("finish")
155150TFif ($$self{"berkeley"})
157450TFunless $$self{$table} or $$self{"data"}
158750TFunless open my $fh, "<", $file
15930TFif ($is_db)
15960TFif require DB_File
15990TFif (tie %bdb, "DB_File", $file, 0, 420, $DB_File::DB_HASH)
16150TFunless read($fh, my $magic_bytes, 4) == 4
16370TFunless seek $fh, 12, 0
16380TFunless read $fh, $header, 4
165650TFif (scalar @messages and my $logger = $$self{"logger"})