Shipment/Label.pm

filter: Statementstmt 77.4% 24 / 31 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 75.0% 6 / 8 Podpod 100% 2 / 2 totaltotal 69.5% 32 / 46 CC 3 SCAR 6.1
CC
3
Cov
69%
save
3.2
data_base64
3.0
BEGIN
1.0
CRAP 1.8
« Shipment/UPS/WSDL/XAVTypes/TransactionReferenceType.pm ↑ Summary Shipment/Package.pm »
1 package Shipment::Label;
2 3 $Shipment::Label::VERSION = '3.11';
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6  
7 3 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 ▶use MooX::Types::MooseLike::Base qw(:all);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10  
11 3 has 'tracking_id' => (
12 is => 'rw',
13 isa => Str,
14 );
15  
16  
17 3 has 'data' => (
18 is => 'rw',
19 isa => Str,
20 );
21  
22  
23 3 has 'content_type' => (
24 is => 'rw',
25 isa => Str,
26 );
27  
28  
29 3 has 'file_name' => (
30 is => 'rw',
31 isa => Str,
32 );
33  
34  
35 0 ▶sub data_base64 {
Subroutine data_base64: not called CC=2 SCAR=10.9
Pod documented
36 0 my ($self) = @_;
37  
38 3 ▶ use MIME::Base64;
Subroutine BEGIN: called CC=1 SCAR=0.0
39  
40 0 ▶ return encode_base64($self->data) if $self->data;
Branch: 1 branch
BranchTrueFalseTotal
if $self->data 0 0 0
41  
42 0 return;
43 }
44  
45  
46 0 ▶sub save {
Subroutine save: not called CC=2 SCAR=11.6
Pod documented
47 0 my ($self, $path) = @_;
48  
49 0 ▶ $path ||= './';
Condition0%0/2
$path ||= "./"
l!l
00
MC/DC0%0/1
$path ||= "./"
$path
Truth table0%0/2
A
A= $path
Aresult
11
00
50  
51 3 ▶ use File::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
52  
53 0 my $f = File::Util->new();
54 0 $f->write_file(
55 file => $path . $self->file_name,
56 bitmask => 0644,
57 content => $self->data,
58 );
59 }
60  
61  
62 3 1;
63  
64 __END__
« Shipment/UPS/WSDL/XAVTypes/TransactionReferenceType.pm ↑ Summary Shipment/Package.pm »