blib/lib/ObjectDB/DBHPool.pm

filter: Statementstmt 41.3% 12 / 29 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 60.0% 3 / 5 Podpod 0.0% 0 / 2 totaltotal 31.2% 15 / 48 SCAR 21.9
CC
4
Cov
32%
dbh
20.0
new
2.0
BEGIN
1.0
CRAP 8.9
« blib/lib/ObjectDB/Related/OneToMany.pm ↑ Summary blib/lib/ObjectDB/Meta/Relationship.pm »
1 package ObjectDB::DBHPool;
2  
3 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 5 our $VERSION = '3.27';
7  
8 5 require Carp;
9 5 ▶use ObjectDB::DBHPool::Connection;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 sub new {
12 0 ▶ my $class = shift;
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
13 0 my (%params) = @_;
14  
15 0 my $self = {};
16 0 bless $self, $class;
17  
18 0 $self->{check_timeout} = $params{check_timeout};
19 0 $self->{dsn} = $params{dsn};
20 0 $self->{username} = $params{username};
21 0 $self->{password} = $params{password};
22 0 $self->{attrs} = $params{attrs};
23 0 $self->{do} = $params{do};
24  
25 0 $self->{connections} = {};
26  
27 0 return $self;
28 }
29  
30 sub dbh {
31 0 ▶ my $self = shift;
Subroutine dbh: not called CC=4 SCAR=30.0
Pod undocumented
32  
33 # From DBIx::Connector
34 0 my $pid_tid = $$;
35 $pid_tid .= '_' . threads->tid
36 0 ▶ if exists $INC{'threads.pm'} && $INC{'threads.pm'};
Branch: 1 branch
BranchTrueFalseTotal
if exists $INC{"threads.pm"} and $INC{"threads.pm"} 0 0 0
Condition0%0/3
exists $INC{"threads.pm"} and $INC{"threads.pm"}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $INC{"threads.pm"} and $INC{"threads.pm"}
exists $INC{"threads.pm"} $INC{"threads.pm"}
Truth table0%0/3
A and B
A= exists $INC{"threads.pm"}B= $INC{"threads.pm"}
ABresult
0X0
100
111
37  
38 my $connection = $self->{connections}->{$pid_tid} ||= ObjectDB::DBHPool::Connection->new(
39 check_timeout => $self->{check_timeout},
40 dsn => $self->{dsn},
41 username => $self->{username},
42 password => $self->{password},
43 attrs => $self->{attrs},
44 do => $self->{do},
45 0 ▶ );
Condition0%0/3
$self->{"connections"}{$pid_tid} ||= "ObjectDB::DBHPool::Connection"->new("check_timeout", $self->{"check_timeout"}, "dsn", $self->{"dsn"}, "username", $self->{"username"}, "password", $self->{"password"}, "attrs", $self->{"attrs"}, "do", $self->{"do"})
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{"connections"}{$pid_tid} ||= "ObjectDB::DBHPool::Connection"->new("check_timeout", $self->{"check_timeout"}, "dsn", $self->{"dsn"}, "username", $self->{"username"}, "password", $self->{"password"}, "attrs", $self->{"attrs"}, "do", $self->{"do"})
$self->{"connections"}{$pid_tid} "ObjectDB::DBHPool::Connection"->new("check_timeout", $self->{"check_timeout"}, "dsn", $self->{"dsn"}, "username", $self->{"username"}, "password", $self->{"password"}, "attrs", $self->{"attrs"}, "do", $self->{"do"})
Truth table0%0/3
A ||= B
A= $self->{"connections"}{$pid_tid}B= "ObjectDB::DBHPool::Connection"->new("check_timeout", $self->{"check_timeout"}, "dsn", $self->{"dsn"}, "username", $self->{"username"}, "password", $self->{"password"}, "attrs", $self->{"attrs"}, "do", $self->{"do"})
ABresult
1X1
011
000
46  
47 0 return $connection->dbh;
48 }
49  
50 5 1;
« blib/lib/ObjectDB/Related/OneToMany.pm ↑ Summary blib/lib/ObjectDB/Meta/Relationship.pm »