Net/OBEX/Packet/Request/Base.pm

filter: Statementstmt 96.0% 24 / 25 Branchbran 50.0% 4 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 3 totaltotal 80.9% 34 / 42 CC 6 SCAR 9.3
CC
6
Cov
85%
new
4.1
headers
2.1
raw
2.0
CRAP 2.5
« Net/OBEX/Packet/Headers/Byte4.pm ↑ Summary Net/OBEX/Packet/Headers/ByteSeq.pm »
1  
2 package Net::OBEX::Packet::Request::Base;
3  
4 13 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 13 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 13 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 13 our $VERSION = '1.001002'; # VERSION
9  
10 4 ▶sub new {
Subroutine new: called CC=4 SCAR=14.2
Pod undocumented
11 4 my $class = shift;
12 4 ▶ croak "Must have even number of arguments to new()"
Branch: 1 branch
BranchTrueFalseTotal
if @_ & 1 0 4 4
13 if @_ & 1;
14 4 my %args = @_;
15 4 $args{ +lc } = delete $args{ $_ } for keys %args;
16  
17 $args{headers} = []
18 4 ▶ unless exists $args{headers};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $args{"headers"} 4 0 4
19  
20 4 return bless \%args, $class;
21 }
22  
23 12 ▶sub headers {
Subroutine headers: called CC=2 SCAR=7.6
Pod undocumented
24 12 my $self = shift;
25 12 ▶ if ( @_ ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 12 12
26 0 $self->{ headers } = shift;
27 }
28 12 return $self->{ headers };
29 }
30  
31 12 ▶sub raw {
Subroutine raw: called CC=2 SCAR=7.0
Pod undocumented
32 12 my $self = shift;
33 12 ▶ if ( @_ ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 12 0 12
34 12 $self->{ raw } = shift;
35 }
36 12 return $self->{ raw };
37 }
38  
39 13 1;
40  
41 __END__
« Net/OBEX/Packet/Headers/Byte4.pm ↑ Summary Net/OBEX/Packet/Headers/ByteSeq.pm »