blib/lib/Unblock/HTTP2.pm

filter: Statementstmt 100% 15 / 15 Branchbran 50.0% 1 / 2 Conditioncond 33.3% 2 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 70.9% 22 / 31 CC 4 SCAR 12.7
CC
4
Cov
78%
error_name
5.5
BEGIN
1.0
BEGIN
1.0
CRAP 3.6
« blib/lib/Unblock/HTTP2/Transaction.pm ↑ Summary blib/lib/Unblock/HTTP2/NativeABI.pm »
1 package Unblock::HTTP2;
2  
3 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 5 our $VERSION = '0.13';
7  
8 5 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
9 5 NO_ERROR => 0,
10 PROTOCOL_ERROR => 1,
11 INTERNAL_ERROR => 2,
12 FLOW_CONTROL_ERROR => 3,
13 SETTINGS_TIMEOUT => 4,
14 STREAM_CLOSED => 5,
15 FRAME_SIZE_ERROR => 6,
16 REFUSED_STREAM => 7,
17 CANCEL => 8,
18 COMPRESSION_ERROR => 9,
19 CONNECT_ERROR => 10,
20 ENHANCE_YOUR_CALM => 11,
21 INADEQUATE_SECURITY => 12,
22 HTTP_1_1_REQUIRED => 13,
23 5 };
24  
25 5 my @ERROR_NAME = qw(
26 NO_ERROR
27 PROTOCOL_ERROR
28 INTERNAL_ERROR
29 FLOW_CONTROL_ERROR
30 SETTINGS_TIMEOUT
31 STREAM_CLOSED
32 FRAME_SIZE_ERROR
33 REFUSED_STREAM
34 CANCEL
35 COMPRESSION_ERROR
36 CONNECT_ERROR
37 ENHANCE_YOUR_CALM
38 INADEQUATE_SECURITY
39 HTTP_1_1_REQUIRED
40 );
41  
42 4 ▶sub error_name {
Subroutine error_name: called CC=4 SCAR=17.1
Pod undocumented
43 4 my ($class, $code) = @_;
44 4 ▶ return unless defined($code) && !ref($code)
Branch: 1 branch
BranchTrueFalseTotal
unless defined $code and not ref $code and "$code" =~ /\A[0-9]+\z/ 0 4 4
Condition33%2/6
defined $code and not ref $code and "$code" =~ /\A[0-9]+\z/
!ll&&!rl&&r
004
defined $code and not ref $code
!ll&&!rl&&r
004
MC/DC0%0/3
defined $code and not ref $code and "$code" =~ /\A[0-9]+\z/
defined $code not ref $code "$code" =~ /\A[0-9]+\z/
Truth table25%1/4
A and not(B) and C
A= defined $codeB= not ref $codeC= "$code" =~ /\A[0-9]+\z/
ABCresult
0XX0
10X0
1100
1111
45 && "$code" =~ /\A[0-9]+\z/;
46 4 return $ERROR_NAME[0 + $code];
47 }
48  
49 5 1;
50  
51 __END__
« blib/lib/Unblock/HTTP2/Transaction.pm ↑ Summary blib/lib/Unblock/HTTP2/NativeABI.pm »