Branch Coverage

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

line%coveragebranch
198100TFif (my $params = Params::Get::get_params(undef, @_))
199100TFif ($$params{"expires_in"} and not $$params{"cache_duration"})
22750TFif (scalar(@_) % 2 == 0) { }
0TFelsif (scalar @_ == 1 and ref $_[0] eq 'HASH') { }
0TFelsif (scalar @_ > 0) { }
323100TFif (scalar @_ == 1 and not ref $_[0]) { }
100TFelsif (my $params = Params::Get::get_params(undef, @_)) { }
32950TFif (not defined $class) { }
100TFelsif ($class eq __PACKAGE__) { }
100TFelsif (&Scalar::Util::blessed($class)) { }
3300TFif (scalar keys %args > 0)
34850TFif (defined $args{"logger"})
34950TFunless (&Scalar::Util::blessed($args{"logger"}) and $args{"logger"}->can("info") and $args{"logger"}->can("error"))
354100TFunless $args{"directory"} or $defaults{"directory"}
356100TFunless -d ($args{'directory'} || $defaults{'directory'})
39650TFif (my $logger = $$params{"logger"})
397100TFif (&Scalar::Util::blessed($logger)) { }
41350TFunless (UNIVERSAL::isa((&CORE::GLOBAL::caller())[0], __PACKAGE__))
420100TF$$self{'sep_char'} ? :
42850TFif $$self{$table}
44050TFif (-r $slurp_file)
4420TFunless "DBI"->can("connect")
44850TFif ($dbh) { }
50TFelsif ($self->_is_berkeley_db('File::Spec'->catfile($dir, "$dbname.db"))) { }
46350TFif (defined $slurp_file and -r $slurp_file) { }
474100TFif (defined $fin) { }
482100TFif (my $filename = $$self{'filename'} || $defaults{'filename'})
486100TFif (defined $slurp_file and -r $slurp_file) { }
487100TFif defined $fin
492100TFif ($$params{'column_names'}) { }
557100TFif (-s $slurp_file <= $max_slurp_size and not $$params{"column_names"})
55850TFif (-s $slurp_file == 0) { }
584100TFif ($$self{'no_entry'}) { }
601100TFif (-r $slurp_file) { }
602100TFif (-s $slurp_file <= $max_slurp_size) { }
61050TFif (ref $$xml{$key} eq 'ARRAY') { }
0TFelsif (ref $xml eq 'ARRAY') { }
0TFelsif (ref $xml eq 'HASH' and not $$self{'no_entry'}) { }
6150TFif (scalar keys %{$xml;} == 1) { }
6160TFif ($$xml{$table}) { }
62850TFif ($$self{'no_entry'}) { }
65450TFif $$self{"data"} and ref($$self{"data"} eq "HASH")
681100TFif ($$self{'no_entry'}) { }
100TFelsif (scalar @_) { }
68750TFif ($$self{"berkeley"})
693100TFif ($$self{"data"})
694100TFif (scalar keys %{$params;} == 0) { }
100TFelsif (scalar keys %{$params;} == 1 and defined $$params{'entry'} and not $$self{'no_entry'}) { }
69650TFif (ref $$self{"data"} eq "HASH")
70850TFif (scalar keys %{$$self{"data"};} <= 10)
728100TFif ($$self{'type'} eq 'CSV' and not $$self{'no_entry'}) { }
73850TFif (ref $arg)
74250TFunless (defined $arg)
75150TFif ($done_where) { }
75750TFif ($arg =~ /[%_]/) { }
764100TFunless ($$self{"no_entry"})
768100TFif (defined $query_args[0]) { }
77650TFif ($c = $$self{'cache'}) { }
7780TFif (defined $query_args[0])
7810TFif (my $rc = $c->get($key))
79550TFif (my $sth = $$self{$table}->prepare($query))
79650TFunless $sth->execute(@query_args)
80250TFif scalar keys %{$href;}
80450TFif ($c)
80850TFunless $$self{"no_fixate"}
85150TFif ($$self{"berkeley"})
858100TFif ($$self{"data"})
859100TFif (scalar keys %{$params;} == 0) { }
50TFelsif (scalar keys %{$params;} == 1 and defined $$params{'entry'} and not $$self{'no_entry'}) { }
86150TFif (ref $$self{"data"} eq "HASH")
875100TFif ($$self{'type'} eq 'CSV' and not $$self{'no_entry'}) { }
88550TFif (ref $arg)
891100TFif ($done_where) { }
897100TFif (not defined $arg) { }
90050TFif ($arg =~ /[%_]/) { }
908100TFunless ($$self{"no_entry"})
91150TFunless (wantarray)
915100TFif (defined $query_args[0]) { }
92350TFif ($c = $$self{'cache'}) { }
9250TFif (wantarray)
9280TFif (defined $query_args[0])
9310TFif (my $rc = $c->get($key))
9330TFwantarray ? :
94550TFif (my $sth = $$self{$table}->prepare($query))
94650TFunless $sth->execute(@query_args)
95250TFunless wantarray
95550TFif ($c)
95950TFif ($rc)
96050TFunless $$self{"no_fixate"}
99250TFif ($$self{"berkeley"})
999100TFif ($$self{"data"})
1000100TFif (scalar keys %{$params;} == 0) { }
50TFelsif (scalar keys %{$params;} == 1 and defined $$params{'entry'} and not $$self{'no_entry'}) { }
100250TFif (ref $$self{"data"} eq "HASH")
10070TF$$self{'data'}{$$params{'entry'}} ? :
1014100TFif ($$self{'type'} eq 'CSV' and not $$self{'no_entry'}) { }
50TFelsif ($$self{'no_entry'}) { }
102650TFif (ref $arg)
103050TFunless (defined $arg)
103950TFif ($done_where) { }
104550TFif ($arg =~ /[%_]/) { }
1052100TFunless ($$self{"no_entry"})
1056100TFif (defined $query_args[0]) { }
106450TFif ($c = $$self{'cache'}) { }
10680TFif (defined $query_args[0])
10710TFif (my $rc = $c->get($key))
108150TFif (my $sth = $$self{$table}->prepare($query))
108250TFunless $sth->execute(@query_args)
1119100TFif (not $$self{'no_entry'}) { }
1128100TFif ($$self{"data"} and not $$self{"no_entry"} and scalar keys %{$params;} == 1 and defined $$params{"entry"})
113350TFif ($$self{"berkeley"})
11360TFif (not $$self{"no_entry"} and scalar keys %{$params;} == 1 and defined $$params{"entry"})
11400TFif ($$self{"no_entry"} and scalar keys %{$params;} == 1 and defined $id and defined $$params{$id})
11410TFif (my $rc = $$self{"berkeley"}{$$params{$id}})
115050TFif (my $t = delete $params->{'table'}) { }
1157100TFif ($$self{"type"} eq "CSV" and not $$self{"no_entry"})
1165100TFif ($done_where) { }
1171100TFif (my $arg = $$params{$c1}) { }
117250TFif (ref $arg)
117750TFif ($arg =~ /[%_]/) { }
1194100TFif (defined $query_args[0]) { }
1202100TFif (defined $query_args[0]) { }
120350TFif (wantarray)
121150TFif ($c = $$self{"cache"})
12120TFif (my $rc = $c->get($key))
12130TFif (wantarray) { }
12140TFif (ref $rc eq "ARRAY")
122350TFunless my $sth = $$self{$table}->prepare($query)
122550TFunless $sth->execute(@query_args)
122750TFif ($c)
12280TFif ($rc) { }
125850TFif ($$self{"berkeley"})
126550TFunless defined $$args{"query"}
127250TFunless $query =~ /\sFROM\s/i
127950TFunless $sth->execute
128550TFunless wantarray
133250TFif $column eq "DESTROY"
133450TFunless my $self = shift()
133650TFunless ref $self
133950TFif exists $self->{'auto_load'} and &boolean($$self{"auto_load"})->isFalse
134250TFunless $column =~ /^[a-zA-Z_][a-zA-Z0-9_]*$/
1347100TFif (ref $_[0] eq 'HASH') { }
100TFelsif (scalar(@_) % 2 == 0) { }
50TFelsif (scalar @_ == 1) { }
135350TFif ($$self{"no_entry"} and not $$self{"berkeley"})
135950TFif ($$self{"berkeley"})
13600TFif (my $id = $$self{"id"})
136650TFunless defined $$self{"type"}
1371100TFif (wantarray and not $distinct) { }
1372100TFif (scalar keys %params == 0 and my $data = $$self{"data"})
1376100TFif ($$self{'type'} eq 'CSV' and not $$self{'no_entry'}) { }
1383100TFif (my $data = $$self{"data"})
138750TFif ($$self{'no_entry'}) { }
100TFelsif (scalar keys %params == 1 and defined(my $key = $params{'entry'})) { }
100TFelsif (scalar keys %params == 0) { }
13900TFif (defined $key)
13930TFif (defined $$row{$key} and $$row{$key} eq $value and my $rc = $$row{$column})
13940TFif (defined $rc) { }
1411100TFif (defined(my $hash = $$data{$key}))
1413100TFunless (exists $hash->{$column})
1418100TFif (defined $rc) { }
142550TFif (wantarray)
142650TFif ($distinct)
1441100TFif (defined $$row{$key} and $$row{$key} eq $value and my $rc = $$row{$column})
144250TFif (defined $rc) { }
145450TFif ($$self{'type'} eq 'CSV' and not $$self{'no_entry'}) { }
146450TFif (defined $value) { }
1465100TFif ($done_where) { }
14740TFif ($done_where) { }
1482100TFif (wantarray) { }
1487100TFif (scalar @args and $args[0]) { }
149450TFif ($cache = $$self{'cache'}) { }
14950TFif (wantarray)
14980TFif (defined $args[0]) { }
15030TFif (my $rc = $cache->get($key))
15050TFwantarray ? :
151450TFunless $sth->execute(@args)
1516100TFif (wantarray)
151850TFif ($cache)
152150TFunless $$self{"no_fixate"}
152650TFif ($cache)
153450TFif (defined $^V and $^V ge "v5.14.0")
153550TFif ${^GLOBAL_PHASE} eq "DESTRUCT"
154050TFif ($$self{"temp"})
1548100TFif (my $dbh = delete $self->{$table_name})
154950TFif $dbh->can("disconnect")
155050TFif $dbh->can("finish")
155450TFif ($$self{"berkeley"})
157750TFunless $$self{$table} or $$self{"data"}
159050TFunless open my $fh, "<", $file
15960TFif ($is_db)
15990TFif require DB_File
16020TFif (tie %bdb, "DB_File", $file, 0, 420, $DB_File::DB_HASH)
16180TFunless read($fh, my $magic_bytes, 4) == 4
16400TFunless seek $fh, 12, 0
16410TFunless read $fh, $header, 4
165950TFif (scalar @messages and my $logger = $$self{"logger"})