AdServer/Database.pm

filter: Statementstmt 87.5% 14 / 16 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod 0.0% 0 / 1 totaltotal 78.2% 18 / 23 CC 3 SCAR 10.4
CC
3
Cov
80%
BUILD
3.4
BEGIN
1.0
CRAP 2.8
« AdServer/Database/YAML.pm ↑ Summary AdServer.pm »
1 package WWW::AdServer::Database;
2 {
3 1 $WWW::AdServer::Database::VERSION = '1.01';
4 }
5 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 has dsn => (
8 is => 'ro',
9 required => 1,
10 );
11  
12 1 has type => (
13 is => 'rw',
14 );
15  
16 1 has db => (
17 is => 'rw',
18 );
19  
20  
21 1 ▶sub BUILD {
Subroutine BUILD: called CC=3 SCAR=12.3
Pod undocumented
22 1 my ($self) = @_;
23  
24 1 ▶ if (not $self->type) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->type) 1 0 1
25 1 ▶ if ($self->dsn =~ /\.yml$/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->dsn =~ /\.yml$/) 1 0 1
26 1 $self->type('YAML');
27 1 with 'WWW::AdServer::Database::YAML';
28 0 $self->db( $self->load($self->dsn) );
29 #$self->db( WWW::AdServer::Database::YAML->new );
30 #$self->db->load($self->dsn);
31 }
32 }
33 0 return;
34 }
35  
36 1 1;
37  
38 __END__
« AdServer/Database/YAML.pm ↑ Summary AdServer.pm »