blib/lib/Tapper/Reports/Web/Controller/Root.pm

filter: Statementstmt 79.4% 27 / 34 Branchbran 75.0% 3 / 4 Conditioncond 77.7% 7 / 9 MC/DCmcdc 50.0% 2 / 4 Subroutinesub 77.7% 7 / 9 Podpod 50.0% 1 / 2 totaltotal 75.8% 47 / 62 CC 6 SCAR 12.3
CC
6
Cov
79%
end
6.3
index
2.0
default
2.0
CRAP 3.4
« blib/lib/Tapper/Reports/Web/Util.pm ↑ Summary blib/lib/Tapper/Reports/Web/View/JSON.pm »
1 package Tapper::Reports::Web::Controller::Root;
2 13 our $AUTHORITY = 'cpan:TAPPER';
3 13 $Tapper::Reports::Web::Controller::Root::VERSION = '5.0.17';
4 13 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 13 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 13 ▶use parent 'Catalyst::Controller';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 # Sets the actions in this controller to be registered with no prefix
9 # so they function identically to actions created in MyApp.pm
10  
11 13 __PACKAGE__->config->{namespace} = '';
12  
13 0 ▶sub index :Path :Args(0)
Subroutine index: not called CC=1 SCAR=6.9
14 {
15 0 my ( $self, $c ) = @_;
16  
17 # the easy way, to avoid fiddling with Mason autohandlers on
18 # simple redirects
19  
20 0 my $body = <<EOF;
21 <html>
22 <head>
23 <meta http-equiv="refresh" content="0; URL=/tapper">
24 <meta name="description" content="Tapper"
25 <title>Tapper</title>
26 </head>
27 EOF
28 0 $c->response->body($body);
29 13 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
30  
31 0 ▶sub default :Path
Subroutine default: not called CC=1 SCAR=6.9
Pod undocumented
32 {
33 0 my ( $self, $c ) = @_;
34 0 $c->response->body( 'Bummer! Page not found' );
35 0 $c->response->status(404);
36 13 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
37  
38 21 ▶sub end : ActionClass('RenderView') {
Subroutine end: called CC=6 SCAR=18.5
Pod documented
39  
40 21 my ( $self, $or_c ) = @_;
41  
42 21 ▶ if (
Branch: 1 branch
BranchTrueFalseTotal
if (not $or_c->response->body and $or_c->res->status < 300 || $or_c->res->status > 399 and $or_c->res->status != 204) 12 9 21
Condition77%7/9
not $or_c->response->body and $or_c->res->status < 300 || $or_c->res->status > 399 and $or_c->res->status != 204
!ll&&!rl&&r
9012
not $or_c->response->body and $or_c->res->status < 300 || $or_c->res->status > 399
!ll&&!rl&&r
8112
$or_c->res->status < 300 or $or_c->res->status > 399
l!l&&r!l&&!r
1201
MC/DC50%2/4
not $or_c->response->body and $or_c->res->status < 300 || $or_c->res->status > 399 and $or_c->res->status != 204
not $or_c->response->body $or_c->res->status < 300 $or_c->res->status > 399 $or_c->res->status != 204
Truth table50%3/6
not(A) and B or C and D
A= not $or_c->response->bodyB= $or_c->res->status < 300C= $or_c->res->status > 399D= $or_c->res->status != 204
ABCDresult
0XXX0
100X0
11X00
10100
11X11
10111
43 !$or_c->response->body
44 && ( $or_c->res->status < 300 || $or_c->res->status > 399 )
45 && ( $or_c->res->status != 204 )
46 ) {
47 12 ▶ if ( $or_c->req->params->{json} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($or_c->req->params->{'json'}) { } 0 12 12
48 0 $or_c->forward('Tapper::Reports::Web::View::JSON');
49 }
50 else {
51 12 $or_c->forward('Tapper::Reports::Web::View::Mason');
52 }
53 }
54  
55 21 return 1;
56  
57 13 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
58  
59 13 1;
60  
61 __END__
« blib/lib/Tapper/Reports/Web/Util.pm ↑ Summary blib/lib/Tapper/Reports/Web/View/JSON.pm »