blib/lib/DBIO/DeploymentHandler/HandlesVersionStorage.pm

filter: Statementstmt 95.2% 20 / 21 Branchbran 50.0% 2 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 77.7% 28 / 36 CC 4 SCAR 11.9
CC
4
Cov
79%
assert_implemented
5.6
BEGIN
1.0
BEGIN
1.0
CRAP 3.3
« blib/lib/DBIO/UUIDColumns.pm ↑ Summary blib/lib/DBIO/DeploymentHandler/HandlesVersioning.pm »
1 package DBIO::DeploymentHandler::HandlesVersionStorage;
2 # ABSTRACT: Interface for version storage methods
3  
4 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 our $VERSION = '0.900007';
8  
9 3 ▶use DBIO::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 3 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13  
14 3 my @REQUIRED = qw(
15 add_database_version
16 database_version
17 delete_database_version
18 version_storage_is_installed
19 );
20  
21 8 ▶sub assert_implemented {
Subroutine assert_implemented: called CC=4 SCAR=17.2
Pod documented
22 8 my ($class, $target) = @_;
23  
24 8 ▶ DBIO::Exception->throw(
Branch: 1 branch
BranchTrueFalseTotal
unless defined $target 0 8 8
25 "$class->assert_implemented called without a target object"
26 ) unless defined $target;
27  
28 8 my @missing = grep { !$target->can($_) } @REQUIRED;
29  
30 8 ▶ return 1 unless @missing;
Branch: 1 branch
BranchTrueFalseTotal
unless @missing 8 0 8
31  
32 0 ▶ DBIO::Exception->throw(
Condition0%0/3
ref $target || $target
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $target || $target
ref $target $target
Truth table0%0/3
A || B
A= ref $targetB= $target
ABresult
1X1
011
000
33 (ref($target) || $target)
34 . " does not implement the $class interface: missing method(s) "
35 . join(', ', @missing)
36 );
37 }
38  
39 3 1;
40  
41 # vim: ts=2 sw=2 expandtab
42  
43 __END__
« blib/lib/DBIO/UUIDColumns.pm ↑ Summary blib/lib/DBIO/DeploymentHandler/HandlesVersioning.pm »