blib/lib/DBIO/DeploymentHandler/HandlesDeploy.pm

filter: Statementstmt 100% 21 / 21 Branchbran 75.0% 3 / 4 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 86.1% 31 / 36 CC 4 SCAR 9.5
CC
4
Cov
89%
assert_implemented
4.2
BEGIN
1.0
BEGIN
1.0
CRAP 2.6
« blib/lib/DBIO/Replicated/Backend.pm ↑ Summary blib/lib/DBIO/Test/Schema/Artwork_to_Artist.pm »
1 package DBIO::DeploymentHandler::HandlesDeploy;
2 # ABSTRACT: Interface for deploy 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 prepare_deploy
16 deploy
17 prepare_resultsource_install
18 install_resultsource
19 prepare_upgrade
20 txn_do
21 upgrade
22 );
23  
24 10 ▶sub assert_implemented {
Subroutine assert_implemented: called CC=4 SCAR=14.3
Pod documented
25 10 my ($class, $target) = @_;
26  
27 10 ▶ DBIO::Exception->throw(
Branch: 1 branch
BranchTrueFalseTotal
unless defined $target 0 10 10
28 "$class->assert_implemented called without a target object"
29 ) unless defined $target;
30  
31 10 my @missing = grep { !$target->can($_) } @REQUIRED;
32  
33 10 ▶ return 1 unless @missing;
Branch: 1 branch
BranchTrueFalseTotal
unless @missing 8 2 10
34  
35 2 ▶ DBIO::Exception->throw(
Condition33%1/3
ref $target || $target
l!l&&r!l&&!r
200
MC/DC0%0/2
ref $target || $target
ref $target $target
Truth table33%1/3
A || B
A= ref $targetB= $target
ABresult
1X1
011
000
36 (ref($target) || $target)
37 . " does not implement the $class interface: missing method(s) "
38 . join(', ', @missing)
39 );
40 }
41  
42 3 1;
43  
44 # vim: ts=2 sw=2 expandtab
45  
46 __END__
« blib/lib/DBIO/Replicated/Backend.pm ↑ Summary blib/lib/DBIO/Test/Schema/Artwork_to_Artist.pm »