| 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'}
MC/DC50%1/2
$init && $init->{'default_location'}
$init
$init->{'default_location'}
Truth table66%2/3
A && B
A= $initB= $init->{'default_location'}
| |||||||||||||||||||||||||
| 11 | 2 | ▶ | my $status = $init && $init->{default_status} || 302; | ||||||||||||||||||||||
|
Condition80%4/5
$init && $init->{'default_status'} || 302
$init and $init->{"default_status"}
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"}
| |||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||
| 16 | 4 | ▶ | croak "No location specified" unless length $r; | ||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||
| 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__ | ||||||||||||||||||||||||