blib/lib/Magpie/Dispatcher/RequestParam.pm

filter: Statementstmt 100% 18 / 18 Branchbran 83.3% 5 / 6 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 3 / 3 Podpod 0.0% 0 / 1 totaltotal 87.8% 29 / 33 CC 5 SCAR 13.6
CC
5
Cov
93%
load_queue
5.0
BEGIN
1.0
__ANON__
1.0
CRAP 3.9
« blib/lib/Magpie/Util.pm ↑ Summary blib/lib/Magpie/Plugin/URITemplate.pm »
1 package Magpie::Dispatcher::RequestParam;
2 8 $Magpie::Dispatcher::RequestParam::VERSION = '1.163200';
3 8 ▶use MooseX::Role::Parameterized;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 # ABSTRACT: Request Parameter Dispatcher
6  
7 8 parameter state_param => (
8 is => 'ro',
9 isa => 'Str',
10 default => 'appstate',
11 );
12  
13 8 ▶role {
Subroutine __ANON__: called CC=1 SCAR=0.0
14 8 my $p = shift;
15  
16 8 has 'state_param' => (
17 is => 'ro',
18 isa => 'Str',
19 default => $p->state_param,
20 );
21 8 };
22  
23 24 ▶sub load_queue {
Subroutine load_queue: called CC=5 SCAR=16.2
Pod undocumented
24 24 my $self = shift;
25 24 my @events = ();
26  
27 24 ▶ if ($self->can('init')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->can("init")) 18 6 24
28 18 push @events, 'init';
29 }
30  
31 24 my $state = $self->request->param( $self->state_param );
32  
33 24 ▶ if ($state and $self->can($state)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($state and $self->can($state)) { } 21 3 24
Condition66%2/3
$state and $self->can($state)
!ll&&!rl&&r
3021
MC/DC50%1/2
$state and $self->can($state)
$state $self->can($state)
Truth table66%2/3
A and B
A= $stateB= $self->can($state)
ABresult
0X0
100
111
34 21 push @events, $state;
35 }
36 else {
37 3 ▶ push(@events, 'default') if $self->can('default');
Branch: 1 branch
BranchTrueFalseTotal
if $self->can("default") 0 3 3
38 }
39  
40 24 return @events;
41 }
42  
43 8 1;
44  
45 __END__
« blib/lib/Magpie/Util.pm ↑ Summary blib/lib/Magpie/Plugin/URITemplate.pm »