Leaky/Types.pm

filter: Statementstmt 75.0% 18 / 24 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 80.0% 4 / 5 Podpod n/a totaltotal 53.6% 22 / 41 CC 4 SCAR 23.6
CC
4
Cov
56%
__ANON__
20.0
__ANON__
1.6
BEGIN
1.0
CRAP 10.6
↑ Summary Leaky/State/Memcached.pm »
1 package Queue::Leaky::Types;
2  
3 3 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 role_type 'Queue::Leaky::Driver';
7 3 role_type 'Queue::Leaky::State';
8  
9 6 ▶my $coerce = sub {
Subroutine __ANON__: called CC=1 SCAR=4.4
10 6 my $default_class = shift;
11 6 my $prefix = shift;
12 0 ▶ return sub {
Subroutine __ANON__: not called CC=4 SCAR=30.0
13 0 my $h = shift;
14 0 ▶ my $module = delete $h->{module} || $default_class;
Condition0%0/3
delete $h->{'module'} || $default_class
l!l&&r!l&&!r
000
MC/DC0%0/2
delete $h->{'module'} || $default_class
delete $h->{'module'} $default_class
Truth table0%0/3
A || B
A= delete $h->{'module'}B= $default_class
ABresult
1X1
011
000
15 0 ▶ if ($prefix && $module !~ s/^\+//) {
Branch: 1 branch
BranchTrueFalseTotal
if ($prefix and not $module =~ s/^\+//) 0 0 0
Condition0%0/3
$prefix and not $module =~ s/^\+//
!ll&&!rl&&r
000
MC/DC0%0/2
$prefix and not $module =~ s/^\+//
$prefix not $module =~ s/^\+//
Truth table0%0/3
A and not(B)
A= $prefixB= not $module =~ s/^\+//
ABresult
0X0
100
111
16 0 $module = join('::', $prefix, $module);
17 }
18 0 Class::MOP::load_class($module);
19 0 $module->new(%$h);
20 6 };
21 3 };
22  
23 3 coerce 'Queue::Leaky::Driver'
24 => from 'HashRef'
25 => $coerce->('Simple', 'Queue::Leaky::Driver')
26 ;
27  
28 3 coerce 'Queue::Leaky::State'
29 => from 'HashRef'
30 => $coerce->('Memory', 'Queue::Leaky::State');
31 ;
32  
33 3 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
34  
35 3 1;
↑ Summary Leaky/State/Memcached.pm »