WebSocket/Cookie/Response.pm

filter: Statementstmt 93.1% 27 / 29 Branchbran 81.2% 13 / 16 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 100% 2 / 2 totaltotal 88.4% 46 / 52 CC 9 SCAR 19.0
CC
9
Cov
89%
to_string
9.1
parse
2.0
BEGIN
1.0
CRAP 6.7
« WebSocket/Response.pm ↑ Summary WebSocket/Message.pm »
1 package Protocol::WebSocket::Cookie::Response;
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  
6 15 ▶use base 'Protocol::WebSocket::Cookie';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 0 ▶sub parse {
Subroutine parse: not called CC=1 SCAR=6.9
Pod documented
9 0 my $self = shift;
10  
11 0 $self->SUPER::parse(@_);
12 }
13  
14 20 ▶sub to_string {
Subroutine to_string: called CC=9 SCAR=22.0
Pod documented
15 20 my $self = shift;
16  
17 20 my $pairs = [];
18  
19 20 push @$pairs, [$self->{name}, $self->{value}];
20  
21 20 ▶ push @$pairs, ['Comment', $self->{comment}] if defined $self->{comment};
Branch: 1 branch
BranchTrueFalseTotal
if defined $self->{"comment"} 0 20 20
22  
23 push @$pairs, ['CommentURL', $self->{comment_url}]
24 20 ▶ if defined $self->{comment_url};
Branch: 1 branch
BranchTrueFalseTotal
if defined $self->{"comment_url"} 0 20 20
25  
26 20 ▶ push @$pairs, ['Discard'] if $self->{discard};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"discard"} 1 19 20
27  
28 20 ▶ push @$pairs, ['Max-Age' => $self->{max_age}] if defined $self->{max_age};
Branch: 1 branch
BranchTrueFalseTotal
if defined $self->{"max_age"} 1 19 20
29  
30 20 ▶ push @$pairs, ['Path' => $self->{path}] if defined $self->{path};
Branch: 1 branch
BranchTrueFalseTotal
if defined $self->{"path"} 16 4 20
31  
32 20 ▶ if (defined $self->{portlist}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->{"portlist"}) 2 18 20
33 $self->{portlist} = [$self->{portlist}]
34 2 ▶ unless ref $self->{portlist} eq 'ARRAY';
Branch: 1 branch
BranchTrueFalseTotal
unless ref $self->{"portlist"} eq "ARRAY" 1 1 2
35 2 my $list = join ' ' => @{$self->{portlist}};
36 2 push @$pairs, ['Port' => "\"$list\""];
37 }
38  
39 20 ▶ push @$pairs, ['Secure'] if $self->{secure};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"secure"} 0 20 20
40  
41 20 push @$pairs, ['Version' => '1'];
42  
43 20 $self->pairs($pairs);
44  
45 20 return $self->SUPER::to_string;
46 }
47  
48 15 1;
49 __END__
« WebSocket/Response.pm ↑ Summary WebSocket/Message.pm »