ResponseHelper/Redirect.pm

filter: Statementstmt 100% 23 / 23 Branchbran 100% 4 / 4 Conditioncond 75.0% 6 / 8 MC/DCmcdc 50.0% 2 / 4 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 89.1% 41 / 46 CC 6 SCAR 9.7
CC
6
Cov
94%
helper
4.0
__ANON__
3.0
BEGIN
1.0
CRAP 2.6
« ResponseHelper/Text.pm ↑ Summary ResponseHelper/Attachment.pm »
1 package Plack::ResponseHelper::Redirect;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Plack::Response;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶sub helper {
Subroutine helper: called CC=4 SCAR=13.9
Pod undocumented
9 2 my $init = shift;
10 2 ▶ my $default_location = $init && $init->{default_location};
Condition66%2/3
$init && $init->{'default_location'}
!ll&&!rl&&r
101
MC/DC50%1/2
$init && $init->{'default_location'}
$init $init->{'default_location'}
Truth table66%2/3
A && B
A= $initB= $init->{'default_location'}
ABresult
0X0
100
111
11 2 ▶ my $status = $init && $init->{default_status} || 302;
Condition80%4/5
$init && $init->{'default_status'} || 302
l!l
11
$init and $init->{"default_status"}
!ll&&!rl&&r
101
MC/DC50%1/2
$init && $init->{'default_status'} || 302
$init $init->{"default_status"}
Truth table66%2/3
A and B
A= $initB= $init->{"default_status"}
ABresult
111
0X0
100
12  
13 4 ▶ return sub {
Subroutine __ANON__: called CC=3 SCAR=11.0
14 4 my $r = shift;
15 4 ▶ $r = $default_location unless defined $r;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $r 1 3 4
16 4 ▶ croak "No location specified" unless length $r;
Branch: 1 branch
BranchTrueFalseTotal
unless length $r 1 3 4
17 3 my $response = Plack::Response->new();
18 3 $response->redirect($r, $status);
19 3 return $response;
20 2 };
21 }
22  
23 1 1;
24  
25 __END__
« ResponseHelper/Text.pm ↑ Summary ResponseHelper/Attachment.pm »