Ebay/Order/Address.pm

filter: Statementstmt 97.0% 33 / 34 Branchbran 50.0% 1 / 2 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 11 / 11 Podpod 100% 8 / 8 totaltotal 90.0% 54 / 60 CC 3 SCAR 4.7
CC
3
Cov
90%
phone
3.6
BEGIN
1.0
BEGIN
1.0
CRAP 1.6
« Ebay/Order.pm ↑ Summary Ebay/Order/Item.pm »
1 package Marketplace::Ebay::Order::Address;
2  
3 5 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use MooX::Types::MooseLike::Base qw(Str);
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 =head1 NAME
8  
9 Marketplace::Ebay::Order::Address
10  
11 =head1 DESCRIPTION
12  
13 Class to handle the xml structures representing an address.
14  
15 This modules doesn't do much, it just provides an uniform iterface
16 with other Marketplace modules.
17  
18 =cut
19  
20 =head1 ACCESSORS
21  
22 =head2 CONSTRUCTOR ARGUMENTS (from xml)
23  
24 =over 4
25  
26 =item * Name
27  
28 =item * Street1
29  
30 =item * Street2
31  
32 =item * CityName
33  
34 =item * PostalCode
35  
36 =item * StateOrProvince
37  
38 =item * Country
39  
40 =item * CountryName
41  
42 =item * Phone
43  
44 =item * AddressOwner
45  
46 =item * ExternalAddressID
47  
48 =item * AddressID
49  
50 =back
51  
52 =cut
53  
54 5 has Name => (is => 'ro', isa => Str);
55 5 has Street1 => (is => 'ro', isa => Str);
56 5 has Street2 => (is => 'ro', isa => Str);
57 5 has CityName => (is => 'ro', isa => Str);
58 5 has PostalCode => (is => 'ro', isa => Str);
59 5 has StateOrProvince => (is => 'ro', isa => Str);
60 5 has Country => (is => 'ro', isa => Str);
61 5 has CountryName => (is => 'ro', isa => Str);
62 5 has Phone => (is => 'ro', isa => Str);
63 5 has AddressOwner => (is => 'ro', isa => Str);
64 5 has ExternalAddressID => (is => 'ro', isa => Str);
65 5 has AddressID => (is => 'ro', isa => Str);
66  
67 =head2 ALIASES
68  
69 =over 4
70  
71 =item address1 (Street1)
72  
73 =item address2 (Street2)
74  
75 =item name (Name)
76  
77 =item city (CityName)
78  
79 =item state (StateOrProvince)
80  
81 =item zip (PostalCode)
82  
83 =item phone (Phone)
84  
85 Return the empty string if "Invalid Request" is found.
86  
87 =item country (Country)
88  
89 =back
90  
91 =cut
92  
93 sub address1 {
94 1 ▶ return shift->Street1;
Subroutine address1: called CC=1 SCAR=0.0
Pod documented
95 }
96  
97 sub address2 {
98 1 ▶ return shift->Street2;
Subroutine address2: called CC=1 SCAR=0.0
Pod documented
99 }
100  
101 sub name {
102 2 ▶ return shift->Name;
Subroutine name: called CC=1 SCAR=0.0
Pod documented
103 }
104  
105 sub city {
106 1 ▶ return shift->CityName;
Subroutine city: called CC=1 SCAR=0.0
Pod documented
107 }
108  
109 sub state {
110 1 ▶ return shift->StateOrProvince;
Subroutine state: called CC=1 SCAR=0.0
Pod documented
111 }
112  
113 sub zip {
114 1 ▶ return shift->PostalCode;
Subroutine zip: called CC=1 SCAR=0.0
Pod documented
115 }
116  
117 sub phone {
118 1 ▶ my $self = shift;
Subroutine phone: called CC=3 SCAR=12.7
Pod documented
119 1 my $phone = $self->Phone;
120 1 ▶ if ($phone and $phone eq 'Invalid Request') {
Branch: 1 branch
BranchTrueFalseTotal
if ($phone and $phone eq 'Invalid Request') { } 1 0 1
Condition33%1/3
$phone and $phone eq "Invalid Request"
!ll&&!rl&&r
001
MC/DC0%0/2
$phone and $phone eq "Invalid Request"
$phone $phone eq "Invalid Request"
Truth table33%1/3
A and B
A= $phoneB= $phone eq "Invalid Request"
ABresult
0X0
100
111
121 1 return '';
122 }
123 else {
124 0 return $phone;
125 }
126 }
127  
128 sub country {
129 1 ▶ return shift->Country;
Subroutine country: called CC=1 SCAR=0.0
Pod documented
130 }
131  
132 5 1;
« Ebay/Order.pm ↑ Summary Ebay/Order/Item.pm »