Mapper/Adapter.pm

filter: Statementstmt 100% 24 / 24 Branchbran 100% 6 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 10 / 10 Podpod 0.0% 0 / 7 totaltotal 85.1% 40 / 47 CC 4 SCAR 6.5
CC
4
Cov
100%
driver
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.9
« Mapper/Data.pm ↑ Summary Mapper/Schema.pm »
1 package Data::Mapper::Adapter;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use parent qw(Data::Mapper::Class);
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 6 ▶sub driver {
Subroutine driver: called CC=4 SCAR=13.9
Pod undocumented
7 6 my ($self, $driver) = @_;
8  
9 6 ▶ if (defined $driver) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $driver) { } 2 4 6
10 2 $self->{driver} = $driver
11 }
12 else {
13 4 ▶ if (ref $self->{driver} eq 'CODE') {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $self->{'driver'} eq 'CODE') { } 2 2 4
14 2 $driver = $self->{driver}->();
15 }
16 else {
17 2 $driver = $self->{driver};
18 }
19  
20 4 ▶ die 'You must set a driver first' if !defined $driver;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $driver 1 3 4
21 }
22  
23 5 $driver;
24 }
25  
26 1 ▶sub create { die 'create() method must be implemented by subclass' }
Subroutine create: called CC=1 SCAR=0.0
Pod undocumented
27 1 ▶sub find { die 'find() method must be implemented by subclass' }
Subroutine find: called CC=1 SCAR=0.0
Pod undocumented
28 1 ▶sub search { die 'search() method must be implemented by subclass' }
Subroutine search: called CC=1 SCAR=0.0
Pod undocumented
29 1 ▶sub update { die 'update() method must be implemented by subclass' }
Subroutine update: called CC=1 SCAR=0.0
Pod undocumented
30 1 ▶sub delete { die 'delete() method must be implemented by subclass' }
Subroutine delete: called CC=1 SCAR=0.0
Pod undocumented
31 1 ▶sub schemata { die 'schemata() method must be implemented by subclass' }
Subroutine schemata: called CC=1 SCAR=0.0
Pod undocumented
32  
33 2 !!1;
« Mapper/Data.pm ↑ Summary Mapper/Schema.pm »