| 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
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
| |||||||||||||||||||||||||||||
| 16 | 0 | ▶ | if ($prefix && $module !~ s/^\+//) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$prefix and not $module =~ s/^\+//
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/^\+//
| |||||||||||||||||||||||||||||
| 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__ | ||||||||||||||||||||||||||||