blib/lib/DBIO/AccessBroker/Static.pm

filter: Statementstmt 100% 25 / 25 Branchbran 100% 6 / 6 Conditioncond 83.3% 5 / 6 MC/DCmcdc 66.6% 2 / 3 Subroutinesub 100% 6 / 6 Podpod 100% 3 / 3 totaltotal 95.9% 47 / 49 CC 7 SCAR 13.0
CC
7
Cov
97%
new
6.0
connect_info_for
2.0
BEGIN
1.0
CRAP 3.7
« blib/lib/DBIO/Test/Schema/Encoded.pm ↑ Summary blib/lib/DBIO/Moose.pm »
1 # ABSTRACT: One fixed set of connection parameters as an AccessBroker
2 package DBIO::AccessBroker::Static;
3  
4 17 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 17 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 17 our $VERSION = '0.900007';
8  
9 17 ▶use base 'DBIO::AccessBroker';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 17 __PACKAGE__->mk_group_accessors('simple' => qw(
12 host port dbname username password
13 ));
14  
15  
16  
17 48 ▶sub new {
Subroutine new: called CC=6 SCAR=17.9
Pod documented
18 48 my ($class, %args) = @_;
19 48 my $self = $class->SUPER::new(%args);
20 48 ▶ $self->host($args{host}) if exists $args{host};
Branch: 1 branch
BranchTrueFalseTotal
if exists $args{"host"} 33 15 48
21 48 ▶ $self->port($args{port}) if exists $args{port};
Branch: 1 branch
BranchTrueFalseTotal
if exists $args{"port"} 17 31 48
22 48 ▶ $self->dbname($args{dbname}) if exists $args{dbname};
Branch: 1 branch
BranchTrueFalseTotal
if exists $args{"dbname"} 46 2 48
23 48 ▶ $self->username($args{username} // '');
Condition100%2/2
$args{"username"} // ""
l!l
462
MC/DC100%1/1
$args{"username"} // ""
$args{"username"}
Truth table100%2/2
A
A= $args{"username"}
Aresult
11
00
24 48 ▶ $self->password($args{password} // '');
Condition100%2/2
$args{"password"} // ""
l!l
417
MC/DC100%1/1
$args{"password"} // ""
$args{"password"}
Truth table100%2/2
A
A= $args{"password"}
Aresult
11
00
25 48 return $self;
26 }
27  
28  
29 95 ▶sub connect_info_for {
Subroutine connect_info_for: called CC=2 SCAR=7.0
Pod documented
30 95 my ($self, $mode) = @_;
31 95 ▶ $mode //= 'write';
Condition50%1/2
$mode //= "write"
l!l
950
MC/DC0%0/1
$mode //= "write"
$mode
Truth table50%1/2
A
A= $mode
Aresult
11
00
32  
33 95 my %info = (
34 host => $self->host,
35 port => $self->port,
36 dbname => $self->dbname,
37 user => $self->username,
38 password => $self->password,
39 );
40  
41 95 return \%info;
42 }
43  
44  
45 95 ▶sub needs_refresh { 0 }
Subroutine needs_refresh: called CC=1 SCAR=0.0
Pod documented
46  
47 17 1;
48  
49 __END__
« blib/lib/DBIO/Test/Schema/Encoded.pm ↑ Summary blib/lib/DBIO/Moose.pm »