lib/ComponentUI/Controller/Root.pm

filter: Statementstmt 84.7% 39 / 46 Branchbran 0.0% 0 / 2 Conditioncond 50.0% 2 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 81.2% 13 / 16 Podpod 20.0% 1 / 5 totaltotal 73.3% 55 / 75 CC 4 SCAR 6.8
CC
4
Cov
79%
static
6.0
root
3.2
bye
2.0
CRAP 2.0
« script/moose_to_rclass.pl ↑ Summary lib/Reaction/UI/Controller/Role/Action/Update.pm »
1 package ComponentUI::Controller::Root;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 ▶BEGIN { extends 'Reaction::UI::Controller::Root'; }
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 3 ▶use aliased 'Reaction::UI::ViewPort';
Subroutine BEGIN: called CC=1 SCAR=0.0
10 3 ▶use aliased 'Reaction::UI::ViewPort::SiteLayout';
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 #
13 # Sets the actions in this controller to be registered with no prefix
14 # so they function identically to actions created in MyApp.pm
15 #
16 3 __PACKAGE__->config(
17 view_name => 'Site',
18 window_title => 'Reaction Test App',
19 namespace => ''
20 );
21  
22 4 ▶sub base :Chained('/') :PathPart('') :CaptureArgs(0) {
Subroutine base: called CC=1 SCAR=0.0
Pod undocumented
23 4 my ($self, $c) = @_;
24 4 $self->push_viewport(SiteLayout,
25 title => 'ComponentUI test title',
26 4 static_base_uri => "${\$c->uri_for('/static')}",
27 meta_info => {
28 http_header => {
29 'Content-Type' => 'text/html;charset=utf-8',
30 },
31 },
32 );
33 3 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
34  
35 1 ▶sub root :Chained('base') :PathPart('') :Args(0) {
Subroutine root: called CC=3 SCAR=11.7
Pod undocumented
36 1 my ($self, $c) = @_;
37 1 ▶ $self->push_viewport(
Condition50%1/2
$c->request->user_agent || ''
l!l
01
MC/DC0%0/1
$c->request->user_agent || ''
$c->request->user_agent
Truth table50%1/2
A
A= $c->request->user_agent
Aresult
11
00
38 ViewPort, (
39 layout => 'index',
40 layout_args => {
41 user_agent => $c->request->user_agent || '',
42 message_to_layout => 'I hate programming.',
43 },
44 ),
45 );
46 1 ▶ $c->log->debug('remote', $c->request->remote_user || '' );
Condition50%1/2
$c->request->remote_user || ''
l!l
01
MC/DC0%0/1
$c->request->remote_user || ''
$c->request->remote_user
Truth table50%1/2
A
A= $c->request->remote_user
Aresult
11
00
47 3 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
48  
49 0 ▶sub bye :Chained('base') :PathPart('bye') :Args(0) {
Subroutine bye: not called CC=1 SCAR=6.9
Pod undocumented
50 0 exit;
51 3 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
52  
53 0 ▶sub static :Chained('base') :PathPart('static') :Args {
Subroutine static: not called CC=2 SCAR=17.9
Pod undocumented
54 0 my ($self, $c, @args) = @_;
55 0 ▶ return if $c->stash->{window}->view->serve_static_file($c, \@args);
Branch: 1 branch
BranchTrueFalseTotal
if $c->stash->{"window"}->view->serve_static_file($c, \@args) 0 0 0
56 0 $c->forward('error_404');
57 3 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
58  
59 0 ▶sub error_404 :Private {
Subroutine error_404: not called CC=1 SCAR=6.9
Pod documented
60 0 my ($self, $c) = @_;
61 0 $c->res->body("Error 404");
62 0 $c->res->status(404);
63 3 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
64  
65 3 1;
« script/moose_to_rclass.pl ↑ Summary lib/Reaction/UI/Controller/Role/Action/Update.pm »