Plugin/PSGIHandler/Interp.pm

filter: Statementstmt 100% 42 / 42 Branchbran 75.0% 3 / 4 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 13 / 13 Podpod n/a totaltotal 95.3% 61 / 64 CC 4 SCAR 4.1
CC
4
Cov
96%
__ANON__
3.0
psgi_comp_path
2.0
__ANON__
1.0
CRAP 1.5
« Plugin/PSGIHandler/Request.pm ↑ Summary Plugin/PSGIHandler/Extra/StackTrace.pm »
1 package Mason::Plugin::PSGIHandler::Interp;
2 1 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 $Mason::Plugin::PSGIHandler::Interp::VERSION = '0.06';
4 }
5 1 ▶use Mason::Plack::Request;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Mason::PluginRole;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Try::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Mason::Plugin::PSGIHandler::Extra::StackTrace;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶method handle_psgi ($env) {
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
11  
12 # local $Plack::Middleware::StackTrace::StackTraceClass =
13 # 'Mason::Plugin::PSGIHandler::Extra::StackTrace';
14 7 my $req = Mason::Plack::Request->new($env);
15 7 ▶ my $response = try {
Subroutine __ANON__: called CC=1 SCAR=0.0
16 7 $self->run( { req => $req }, $self->psgi_comp_path($req), $self->psgi_parameters($req) )
17 ->plack_response;
18 }
19 2 ▶ catch {
Subroutine __ANON__: called CC=3 SCAR=11.0
20 2 my $err = $_;
21 2 ▶ if ( blessed($err) && $err->isa('Mason::Exception::TopLevelNotFound') ) {
Branch: 1 branch
BranchTrueFalseTotal
if (builtin::blessed($err) and $err->isa('Mason::Exception::TopLevelNotFound')) { } 1 1 2
Condition66%2/3
builtin::blessed($err) and $err->isa("Mason::Exception::TopLevelNotFound")
!ll&&!rl&&r
101
MC/DC50%1/2
builtin::blessed($err) and $err->isa("Mason::Exception::TopLevelNotFound")
builtin::blessed($err) $err->isa("Mason::Exception::TopLevelNotFound")
Truth table66%2/3
A and B
A= builtin::blessed($err)B= $err->isa("Mason::Exception::TopLevelNotFound")
ABresult
0X0
100
111
22 1 Mason::Plack::Response->new(404);
23 }
24 else {
25 1 local $SIG{__DIE__} = undef;
26 1 die $err;
27 }
28 7 };
29 6 return $response->finalize;
30 1 }
31  
32 1 ▶method psgi_comp_path ($req) {
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine psgi_comp_path: called CC=2 SCAR=7.0
33 7 my $comp_path = $req->path;
34 7 ▶ $comp_path = "/$comp_path" if substr( $comp_path, 0, 1 ) ne '/';
Branch: 1 branch
BranchTrueFalseTotal
if substr($comp_path, 0, 1) ne "/" 0 7 7
35 7 return $comp_path;
36 1 }
37  
38 1 ▶method psgi_parameters ($req) {
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine psgi_parameters: called CC=1 SCAR=0.0
39 7 return $req->parameters;
40 1 }
41  
42 1 1;
« Plugin/PSGIHandler/Request.pm ↑ Summary Plugin/PSGIHandler/Extra/StackTrace.pm »