Client/Backend/http.pm

filter: Statementstmt 100% 28 / 28 Branchbran 50.0% 1 / 2 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 8 / 8 Podpod 100% 2 / 2 totaltotal 88.8% 40 / 45 CC 3 SCAR 5.0
CC
3
Cov
91%
new
3.2
BEGIN
1.0
BEGIN
1.0
CRAP 1.7
« Client/Backend/psgi_local.pm ↑ Summary Client/Backend.pm »
1 package Plack::Client::Backend::http;
2 5 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
3 5 $Plack::Client::Backend::http::VERSION = '0.06';
4 }
5 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 # ABSTRACT: backend for handling HTTP requests
8  
9 5 ▶use Plack::App::Proxy;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 5 ▶use base 'Plack::Client::Backend';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13  
14  
15 4 ▶sub new {
Subroutine new: called CC=3 SCAR=11.6
Pod documented
16 4 my $class = shift;
17 4 my %args = @_;
18  
19 $args{proxy} ||= Plack::App::Proxy->new(
20 exists $args{proxy_args} ? $args{proxy_args} : ()
21 4 ▶ );
Branch: 1 branch
BranchTrueFalseTotal
exists $args{'proxy_args'} ? : 0 4 4
Condition33%1/3
$args{"proxy"} ||= "Plack::App::Proxy"->new(exists $args{"proxy_args"} ? $args{"proxy_args"} : ())
l!l&&r!l&&!r
040
MC/DC0%0/2
$args{"proxy"} ||= "Plack::App::Proxy"->new(exists $args{"proxy_args"} ? $args{"proxy_args"} : ())
$args{"proxy"} "Plack::App::Proxy"->new(exists $args{"proxy_args"} ? $args{"proxy_args"} : ())
Truth table33%1/3
A ||= B
A= $args{"proxy"}B= "Plack::App::Proxy"->new(exists $args{"proxy_args"} ? $args{"proxy_args"} : ())
ABresult
1X1
011
000
22  
23 4 my $self = $class->SUPER::new(@_);
24  
25 4 $self->{proxy} = $args{proxy}->to_app;
26  
27 4 return $self;
28 }
29  
30 38 ▶sub _proxy { shift->{proxy} }
Subroutine _proxy: called CC=1 SCAR=0.0
31  
32  
33 38 ▶sub app_from_request {
Subroutine app_from_request: called CC=1 SCAR=0.0
Pod documented
34 38 my $self = shift;
35 38 my ($req) = @_;
36  
37 38 my $uri = $req->uri->clone;
38 38 $uri->path('/');
39 38 $uri->query(undef);
40 38 $req->env->{'plack.proxy.remote'} = $uri->as_string;
41 38 return $self->_proxy;
42 }
43  
44 5 1;
45  
46 __END__
« Client/Backend/psgi_local.pm ↑ Summary Client/Backend.pm »