Chain/UA/LWP.pm

filter: Statementstmt 100% 28 / 28 Branchbran 66.6% 4 / 6 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 84.4% 38 / 45 CC 6 SCAR 14.3
CC
6
Cov
89%
request_chain
6.3
BEGIN
1.0
BEGIN
1.0
CRAP 4.2
« Chain.pm ↑ Summary Chain/UA.pm »
1 package WWW::Chain::UA::LWP;
2 5 our $VERSION = '0.101';
3 5 our $AUTHORITY = 'cpan:GETTY';
4 # ABSTRACT: Using LWP::UserAgent to execute WWW::Chain chains
5  
6 5 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 5 extends 'LWP::UserAgent';
8  
9 5 with qw( WWW::Chain::UA );
10  
11 5 ▶use HTTP::Cookies;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 5 ▶use Scalar::Util 'blessed';
Subroutine BEGIN: called CC=1 SCAR=0.0
13 5 ▶use Safe::Isa;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 2 ▶sub request_chain {
Subroutine request_chain: called CC=6 SCAR=18.4
Pod undocumented
16 2 my ( $self, $chain ) = @_;
17 2 ▶ die __PACKAGE__."->request_chain needs a WWW::Chain object as parameter"
Branch: 1 branch
BranchTrueFalseTotal
unless builtin::blessed($chain) and $chain->$WWW::Chain::UA::LWP::_isa("WWW::Chain") 0 2 2
Condition33%1/3
builtin::blessed($chain) and $chain->$WWW::Chain::UA::LWP::_isa("WWW::Chain")
!ll&&!rl&&r
002
MC/DC0%0/2
builtin::blessed($chain) and $chain->$WWW::Chain::UA::LWP::_isa("WWW::Chain")
builtin::blessed($chain) $chain->$WWW::Chain::UA::LWP::_isa("WWW::Chain")
Truth table33%1/3
A and B
A= builtin::blessed($chain)B= $chain->$WWW::Chain::UA::LWP::_isa("WWW::Chain")
ABresult
0X0
100
111
18 unless ( blessed($chain) && $chain->$_isa('WWW::Chain') );
19 2 ▶ $self->cookie_jar({}) unless $self->cookie_jar;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->cookie_jar 2 0 2
20 2 ▶ while (!$chain->done) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($chain->done) 4 2 6
21 4 my @responses;
22 4 for (@{$chain->next_requests}) {
23 4 my $response = $self->request($_);
24 4 push @responses, $response;
25 }
26 4 $chain->next_responses(@responses);
27 }
28 2 return $chain;
29 }
30  
31 5 1;
32  
33 __END__
« Chain.pm ↑ Summary Chain/UA.pm »