blib/lib/Unblock/HTTP3/Client.pm

filter: Statementstmt 100% 31 / 31 Branchbran 100% 8 / 8 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 7 / 7 Podpod 100% 2 / 2 totaltotal 96.2% 51 / 53 CC 7 SCAR 14.4
CC
7
Cov
98%
request
7.0
BEGIN
1.0
BEGIN
1.0
CRAP 4.2
« blib/lib/Unblock/HTTP3/Body/Stream.pm ↑ Summary blib/lib/Unblock/HTTP3/_Bytes.pm »
1 package Unblock::HTTP3::Client;
2  
3 15 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 15 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 15 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 15 ▶use Uniform::HTTP::Request 0.06 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 15 ▶use parent 'Unblock::HTTP3::Connection';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 15 our $VERSION = '0.14';
11  
12 17 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
13 17 my ($class, %option) = @_;
14 17 return $class->_new('client', %option);
15 }
16  
17 51 ▶sub request {
Subroutine request: called CC=7 SCAR=19.5
Pod documented
18 51 my ($self, @arg) = @_;
19  
20 51 my ($request, %option);
21 51 ▶ if (@arg && ref($arg[0])) {
Branch: 1 branch
BranchTrueFalseTotal
if (@arg and ref $arg[0]) { } 39 12 51
Condition66%2/3
@arg and ref $arg[0]
!ll&&!rl&&r
01239
MC/DC50%1/2
@arg and ref $arg[0]
@arg ref $arg[0]
Truth table66%2/3
A and B
A= @argB= ref $arg[0]
ABresult
0X0
100
111
22 39 $request = shift @arg;
23 39 ▶ croak 'request(): options must be key/value pairs' if @arg % 2;
Branch: 1 branch
BranchTrueFalseTotal
if @arg % 2 1 38 39
24 38 %option = @arg;
25 } else {
26 12 ▶ croak 'request(): fields must be key/value pairs' if @arg % 2;
Branch: 1 branch
BranchTrueFalseTotal
if @arg % 2 1 11 12
27 11 my %field = @arg;
28 11 for my $name (qw(
29 stream_body receive_body datagrams early_data
30 on_informational on_response on_body on_data on_finish on_complete on_error on_drain
31 )) {
32 132 ▶ $option{$name} = delete $field{$name} if exists $field{$name};
Branch: 1 branch
BranchTrueFalseTotal
if exists $field{$name} 24 108 132
33 }
34 11 $request = Uniform::HTTP::Request->new(%field);
35 }
36  
37 49 return $self->SUPER::request($request, %option);
38 }
39  
40 15 1;
41  
42 __END__
« blib/lib/Unblock/HTTP3/Body/Stream.pm ↑ Summary blib/lib/Unblock/HTTP3/_Bytes.pm »