Mvalve/Types.pm

filter: Statementstmt 78.7% 26 / 33 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 60.0% 30 / 50 CC 4 SCAR 23.6
CC
4
Cov
63%
__ANON__
20.0
__ANON__
1.6
BEGIN
1.0
CRAP 10.6
« Mvalve/Base.pm ↑ Summary Mvalve/Writer.pm »
1 package Mvalve::Types;
2 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 role_type 'Mvalve::Queue';
6 1 role_type 'Mvalve::State';
7 1 role_type 'Mvalve::Throttler';
8 1 role_type 'Mvalve::Logger';
9  
10 4 ▶my $coerce = sub {
Subroutine __ANON__: called CC=1 SCAR=4.6
11 4 my $default_class = shift;
12 4 my $prefix = shift;
13 0 ▶ return sub {
Subroutine __ANON__: not called CC=4 SCAR=30.0
14 0 my $h = shift;
15 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
16 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
17 0 $module = join('::', $prefix, $module);
18 }
19 0 Class::MOP::load_class($module);
20 0 $module->new(%{$h->{args}});
21 4 };
22 1 };
23  
24 1 *__coerce_throttler = $coerce->('Data::Valve', 'Mvalve::Throttler');
25 1 *__coerce_queue = $coerce->('Q4M', 'Mvalve::Queue');
26 1 *__coerce_state = $coerce->('Memory', 'Mvalve::State');
27 1 *__coerce_logger = $coerce->('Stats', 'Mvalve::Logger');
28  
29 1 coerce 'Mvalve::Throttler'
30 => from 'HashRef'
31 => \&__coerce_throttler
32 ;
33  
34 1 coerce 'Mvalve::Queue'
35 => from 'HashRef'
36 => \&__coerce_queue
37 ;
38  
39 1 coerce 'Mvalve::State'
40 => from 'HashRef'
41 => \&__coerce_state
42 ;
43  
44 1 coerce 'Mvalve::Logger'
45 => from 'HashRef'
46 => \&__coerce_logger
47 ;
48  
49 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
50  
51 1 1;
52  
53 __END__
« Mvalve/Base.pm ↑ Summary Mvalve/Writer.pm »