lib/OpusVL/AppKit/Controller/Root.pm

filter: Statementstmt 96.7% 59 / 61 Branchbran 58.3% 7 / 12 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 16 / 16 Podpod 66.6% 4 / 6 totaltotal 87.0% 87 / 100 CC 8 SCAR 9.3
CC
8
Cov
88%
end
6.5
access_denied
3.0
default
2.0
CRAP 2.5
« blib/lib/OpusVL/AppKit/Plugin/AppKit/FeatureList.pm ↑ Summary lib/OpusVL/AppKit/View/AppKitTT.pm »
1 package OpusVL::AppKit::Controller::Root;
2  
3  
4 ############################################################################################################
5 8 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 8 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 8 ▶BEGIN { extends 'Catalyst::Controller'; }
Subroutine BEGIN: called CC=1 SCAR=0.0
9 8 with 'OpusVL::AppKit::RolesFor::Controller::GUI';
10  
11 8 ▶use File::ShareDir ':ALL';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 8 __PACKAGE__->config->{namespace} = '';
14
15 sub auto
16 89 ▶ : Action
Subroutine auto: called CC=1 SCAR=0.0
Pod documented
17 : AppKitAllAccess
18 {
19 89 my ( $self, $c ) = @_;
20 89 return 1;
21 8 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23  
24 sub index
25 4 ▶ :Path
Subroutine index: called CC=1 SCAR=0.0
Pod documented
26 :Args(0)
27 : AppKitFeature('Home Page')
28 {
29 4 my ( $self, $c ) = @_;
30  
31 4 $c->_appkit_stash_portlets;
32  
33 4 $c->stash->{template} = 'index.tt';
34 4 $c->stash->{homepage} = 1;
35 8 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
36  
37  
38 2 ▶sub default :Path
Subroutine default: called CC=2 SCAR=7.0
Pod undocumented
39 {
40 2 my ( $self, $c ) = @_;
41 2 ▶ delete $c->stash->{current_view} if defined $c->stash->{current_view}; # ensure default view.
Branch: 1 branch
BranchTrueFalseTotal
if defined $c->stash->{"current_view"} 0 2 2
42 2 $c->stash->{template} = '404.tt';
43 2 $c->response->status(404);
44 2 $c->stash->{homepage} = 1;
45 2 $c->detach;
46 8 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
47  
48 1 ▶sub not_found :Private
Subroutine not_found: called CC=1 SCAR=0.0
Pod undocumented
49 {
50 1 my ($self, $c) = @_;
51 1 $c->forward('/default');
52 8 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
53  
54 5 ▶sub access_denied : Private
Subroutine access_denied: called CC=3 SCAR=11.0
Pod documented
55 {
56 5 my ( $self, $c ) = @_;
57 5 ▶ $c->REST_403 if($c->in_REST_action);
Branch: 1 branch
BranchTrueFalseTotal
if $c->in_REST_action 1 4 5
58 4 $c->stash->{template} = '403.tt';
59 4 ▶ delete $c->stash->{current_view} if defined $c->stash->{current_view}; # ensure default view.
Branch: 1 branch
BranchTrueFalseTotal
if defined $c->stash->{"current_view"} 0 4 4
60 4 $c->response->status(403);
61 4 $c->stash->{homepage} = 1;
62 4 $c->detach('View::AppKitTT');
63 8 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
64  
65  
66 81 ▶sub end : ActionClass('RenderView')
Subroutine end: called CC=5 SCAR=18.7
Pod documented
67 {
68 81 my ( $self, $c ) = @_;
69 81 ▶ unless($c->config->{no_clickjack_protection} || $c->stash->{no_clickjack_protection})
Branch: 1 branch
BranchTrueFalseTotal
unless ($c->config->{"no_clickjack_protection"} or $c->stash->{"no_clickjack_protection"}) 81 0 81
Condition33%1/3
$c->config->{"no_clickjack_protection"} or $c->stash->{"no_clickjack_protection"}
l!l&&r!l&&!r
0081
MC/DC0%0/2
$c->config->{"no_clickjack_protection"} or $c->stash->{"no_clickjack_protection"}
$c->config->{"no_clickjack_protection"} $c->stash->{"no_clickjack_protection"}
Truth table33%1/3
A or B
A= $c->config->{"no_clickjack_protection"}B= $c->stash->{"no_clickjack_protection"}
ABresult
1X1
011
000
70 {
71 81 ▶ if($c->config->{clickjack_same_origin})
Branch: 1 branch
BranchTrueFalseTotal
if ($c->config->{'clickjack_same_origin'}) { } 0 81 81
72 {
73 0 $c->response->headers->header( 'X-FRAME-OPTIONS' => 'SAMEORIGIN' );
74 }
75 else
76 {
77 81 $c->response->headers->header( 'X-FRAME-OPTIONS' => 'DENY' );
78 }
79 }
80 81 $c->response->headers->header('X-XSS-Protection' => '1; mode=block');
81 81 ▶ if($c->config->{ssl_only})
Branch: 1 branch
BranchTrueFalseTotal
if ($c->config->{"ssl_only"}) 0 81 81
82 {
83 0 $c->response->headers->header('Strict-Transport-Security' => 'max-age=31536000; includeSubDomains');
84 }
85 81 $c->response->headers->header('X-Content-Type-Options' => 'nosniff');
86 8 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
87  
88 8 1;
89  
90 __END__
« blib/lib/OpusVL/AppKit/Plugin/AppKit/FeatureList.pm ↑ Summary lib/OpusVL/AppKit/View/AppKitTT.pm »