Branch Coverage

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

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])
7820TFif (my $rc = $c->get($key))
79650TFif (my $sth = $$self{$table}->prepare($query))
79750TFunless $sth->execute(@query_args)
80350TFif scalar keys %{$href;}
80550TFif ($c)
80950TFunless $$self{"no_fixate"}
85250TFif ($$self{"berkeley"})
859100TFif ($$self{"data"})
860100TFif (scalar keys %{$params;} == 0) { }
50TFelsif (scalar keys %{$params;} == 1 and defined $$params{'entry'} and not $$self{'no_entry'}) { }
86250TFif (ref $$self{"data"} eq "HASH")
876100TFif ($$self{'type'} eq 'CSV' and not $$self{'no_entry'}) { }
88650TFif (ref $arg)
892100TFif ($done_where) { }
898100TFif (not defined $arg) { }
90150TFif ($arg =~ /[%_]/) { }
909100TFunless ($$self{"no_entry"})
91250TFunless (wantarray)
916100TFif (defined $query_args[0]) { }
92450TFif ($c = $$self{'cache'}) { }
9260TFif (wantarray)
9290TFif (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)
1121100TFif (not $$self{'no_entry'}) { }
1130100TFif ($$self{"data"} and not $$self{"no_entry"} and scalar keys %{$params;} == 1 and defined $$params{"entry"})
113550TFif ($$self{"berkeley"})
11380TFif (not $$self{"no_entry"} and scalar keys %{$params;} == 1 and defined $$params{"entry"})
11420TFif ($$self{"no_entry"} and scalar keys %{$params;} == 1 and defined $id and defined $$params{$id})
11430TFif (my $rc = $$self{"berkeley"}{$$params{$id}})
115250TFif (my $t = delete $params->{'table'}) { }
1159100TFif ($$self{"type"} eq "CSV" and not $$self{"no_entry"})
1167100TFif ($done_where) { }
1173100TFif (my $arg = $$params{$c1}) { }
117450TFif (ref $arg)
117950TFif ($arg =~ /[%_]/) { }
1196100TFif (defined $query_args[0]) { }
1204100TFif (defined $query_args[0]) { }
120550TFif (wantarray)
121350TFif ($c = $$self{"cache"})
12140TFif (my $rc = $c->get($key))
12150TFif (wantarray) { }
12160TFif (ref $rc eq "ARRAY")
122550TFunless my $sth = $$self{$table}->prepare($query)
122750TFunless $sth->execute(@query_args)
122950TFif ($c)
12300TFif ($rc) { }
126250TFif ($$self{"berkeley"})
127050TFunless defined $$args{"query"}
127750TFunless $query =~ /\sFROM\s/i
1284100TFif (exists $args->{'args'}) { }
128550TFunless $sth->execute($$args{"args"})
128750TFunless $sth->execute
129450TFunless wantarray
134150TFif $column eq "DESTROY"
134350TFunless my $self = shift()
134550TFunless ref $self
134850TFif exists $self->{'auto_load'} and &boolean($$self{"auto_load"})->isFalse
135150TFunless $column =~ /^[a-zA-Z_][a-zA-Z0-9_]*$/
1356100TFif (ref $_[0] eq 'HASH') { }
100TFelsif (scalar(@_) % 2 == 0) { }
50TFelsif (scalar @_ == 1) { }
136250TFif ($$self{"no_entry"} and not $$self{"berkeley"})
136850TFif ($$self{"berkeley"})
13690TFif (my $id = $$self{"id"})
137550TFunless defined $$self{"type"}
1380100TFif (wantarray and not $distinct) { }
1381100TFif (scalar keys %params == 0 and my $data = $$self{"data"})
1385100TFif ($$self{'type'} eq 'CSV' and not $$self{'no_entry'}) { }
1392100TFif (my $data = $$self{"data"})
139650TFif ($$self{'no_entry'}) { }
100TFelsif (scalar keys %params == 1 and defined(my $key = $params{'entry'})) { }
100TFelsif (scalar keys %params == 0) { }
13990TFif (defined $key)
14020TFif (defined $$row{$key} and $$row{$key} eq $value and my $rc = $$row{$column})
14030TFif (defined $rc) { }
1420100TFif (defined(my $hash = $$data{$key}))
1422100TFunless (exists $hash->{$column})
1427100TFif (defined $rc) { }
143450TFif (wantarray)
143550TFif ($distinct)
1450100TFif (defined $$row{$key} and $$row{$key} eq $value and my $rc = $$row{$column})
145150TFif (defined $rc) { }
146350TFif ($$self{'type'} eq 'CSV' and not $$self{'no_entry'}) { }
147350TFif (defined $value) { }
1474100TFif ($done_where) { }
14830TFif ($done_where) { }
1491100TFif (wantarray) { }
1496100TFif (scalar @args and $args[0]) { }
150350TFif ($cache = $$self{'cache'}) { }
15040TFif (wantarray)
15070TFif (defined $args[0]) { }
15120TFif (my $rc = $cache->get($key))
15140TFwantarray ? :
152350TFunless $sth->execute(@args)
1525100TFif (wantarray)
152750TFif ($cache)
153050TFunless $$self{"no_fixate"}
153550TFif ($cache)
154350TFif (defined $^V and $^V ge "v5.14.0")
154450TFif ${^GLOBAL_PHASE} eq "DESTRUCT"
154950TFif ($$self{"temp"})
1557100TFif (my $dbh = delete $self->{$table_name})
155850TFif $dbh->can("disconnect")
155950TFif $dbh->can("finish")
156350TFif ($$self{"berkeley"})
158650TFunless $$self{$table} or $$self{"data"}
159950TFunless open my $fh, "<", $file
16050TFif ($is_db)
16080TFif require DB_File
16110TFif (tie %bdb, "DB_File", $file, 0, 420, $DB_File::DB_HASH)
16270TFunless read($fh, my $magic_bytes, 4) == 4
16490TFunless seek $fh, 12, 0
16500TFunless read $fh, $header, 4
166850TFif (scalar @messages and my $logger = $$self{"logger"})