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.141660';
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 role {
14 8 ▶ my $p = shift;
Subroutine __ANON__: called CC=1 SCAR=0.0
15  
16 8 has 'state_param' => (
17 is => 'ro',
18 isa => 'Str',
19 default => $p->state_param,
20 );
21 8 };
22  
23 sub load_queue {
24 24 ▶ my $self = shift;
Subroutine load_queue: called CC=5 SCAR=16.2
Pod undocumented
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  
46 =pod
47  
48 =head1 NAME
49  
50 Magpie::Dispatcher::RequestParam - Request Parameter Dispatcher
51  
52 =head1 VERSION
53  
54 version 1.141660
55  
56 =head1 AUTHORS
57  
58 =over 4
59  
60 =item *
61  
62 Kip Hampton <kip.hampton@tamarou.com>
63  
64 =item *
65  
66 Chris Prather <chris.prather@tamarou.com>
67  
68 =back
69  
70 =head1 COPYRIGHT AND LICENSE
71  
72 This software is copyright (c) 2011 by Tamarou, LLC.
73  
74 This is free software; you can redistribute it and/or modify it under
75 the same terms as the Perl 5 programming language system itself.
76  
77 =cut
78  
79  
80 __END__
81  
« blib/lib/Magpie/Util.pm ↑ Summary blib/lib/Magpie/Plugin/URITemplate.pm »