DRI/Protocol/EPP/Core/Status.pm

filter: Statementstmt 31.3% 16 / 51 Branchbran 0.0% 0 / 22 Conditioncond 0.0% 0 / 27 MC/DCmcdc 0.0% 0 / 15 Subroutinesub 29.4% 5 / 17 Podpod 75.0% 9 / 12 totaltotal 20.8% 30 / 144 CC 21 SCAR 35.9
CC
21
Cov
16%
build_xml
110.0
can_delete
20.0
new
12.0
CRAP 36.2
« DRI/Protocol/EPP/Extensions/Keygroup.pm ↑ Summary DRI/Protocol/EPP/Extensions/IT/Contact.pm »
1 ## Domain Registry Interface, EPP Status
2 ##
3 ## Copyright (c) 2005,2007,2008,2010,2014 Patrick Mevzek <netdri@dotandco.com>. All rights reserved.
4 ##
5 ## This file is part of Net::DRI
6 ##
7 ## Net::DRI is free software; you can redistribute it and/or modify
8 ## it under the terms of the GNU General Public License as published by
9 ## the Free Software Foundation; either version 2 of the License, or
10 ## (at your option) any later version.
11 ##
12 ## See the LICENSE file that comes with this distribution for more details.
13 ####################################################################################################
14  
15 package Net::DRI::Protocol::EPP::Core::Status;
16  
17 1 ▶use base qw!Net::DRI::Data::StatusList!;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 1 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 1 ▶use Net::DRI::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 =pod
26  
27 =head1 NAME
28  
29 Net::DRI::Protocol::EPP::Core::Status - EPP Status for Net::DRI
30  
31 =head1 DESCRIPTION
32  
33 Please see the README file for details.
34  
35 =head1 SUPPORT
36  
37 For now, support questions should be sent to:
38  
39 E<lt>netdri@dotandco.comE<gt>
40  
41 Please also see the SUPPORT file in the distribution.
42  
43 =head1 SEE ALSO
44  
45 E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt>
46  
47 =head1 AUTHOR
48  
49 Patrick Mevzek, E<lt>netdri@dotandco.comE<gt>
50  
51 =head1 COPYRIGHT
52  
53 Copyright (c) 2005,2007,2008,2010,2014 Patrick Mevzek <netdri@dotandco.com>.
54 All rights reserved.
55  
56 This program is free software; you can redistribute it and/or modify
57 it under the terms of the GNU General Public License as published by
58 the Free Software Foundation; either version 2 of the License, or
59 (at your option) any later version.
60  
61 See the LICENSE file that comes with this distribution for more details.
62  
63 =cut
64  
65 ####################################################################################################
66  
67 sub new
68 0 ▶{
Subroutine new: not called CC=3 SCAR=24.8
Pod undocumented
69 0 my $class=shift;
70 0 my $self=$class->SUPER::new('epp','1.0');
71  
72 0 my %s=('delete' => 'clientDeleteProhibited',
73 'renew' => 'clientRenewProhibited',
74 'update' => 'clientUpdateProhibited',
75 'transfer' => 'clientTransferProhibited',
76 'publish' => 'clientHold',
77 );
78 0 $self->_register_pno(\%s);
79  
80 0 my $msg=shift;
81 0 ▶ return $self unless defined $msg;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $msg 0 0 0
82 0 ▶ Net::DRI::Exception::err_invalid_parameters() unless ref $msg eq 'ARRAY';
Branch: 1 branch
BranchTrueFalseTotal
unless ref $msg eq "ARRAY" 0 0 0
83 0 $self->add(@$msg);
84 0 return $self;
85 }
86  
87 sub is_core_status
88 0 ▶{
Subroutine is_core_status: not called CC=1 SCAR=6.9
Pod undocumented
89 0 return (shift=~m/^client(?:Hold|(?:Delete|Renew|Update|Transfer)Prohibited)$/);
90 }
91  
92 sub build_xml
93 0 ▶{
Subroutine build_xml: not called CC=10 SCAR=47.0
Pod undocumented
94 0 my ($self,$name,$range)=@_;
95 0 ▶ $range='core' unless defined($range);
Branch: 1 branch
BranchTrueFalseTotal
unless defined $range 0 0 0
96 0 my @d;
97 0 my $rd=$self->status_details();
98 0 ▶ while(my ($k,$v)=each(%$rd))
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %$rd) 0 0 0
99 {
100 0 ▶ next if (($range eq 'core') xor is_core_status($k));
Branch: 1 branch
BranchTrueFalseTotal
if $range eq "core" xor is_core_status($k) 0 0 0
Condition0%0/4
$range eq "core" xor is_core_status($k)
l&&rl&&!r!l&&r!l&&!r
0000
MC/DC0%0/2
$range eq "core" xor is_core_status($k)
$range eq "core" is_core_status($k)
Truth table0%0/4
A xor B
A= $range eq "core"B= is_core_status($k)
ABresult
110
101
011
000
101 0 ▶ if ($v && ref $v eq 'HASH' && keys %$v)
Branch: 1 branch
BranchTrueFalseTotal
if ($v and ref $v eq 'HASH' and keys %$v) { } 0 0 0
Condition0%0/6
$v and ref $v eq "HASH" and keys %$v
!ll&&!rl&&r
000
$v and ref $v eq "HASH"
!ll&&!rl&&r
000
MC/DC0%0/3
$v and ref $v eq "HASH" and keys %$v
$v ref $v eq "HASH" keys %$v
Truth table0%0/4
A and B and C
A= $vB= ref $v eq "HASH"C= keys %$v
ABCresult
0XX0
10X0
1100
1111
102 {
103 0 my %tmp=(s => $k);
104 0 ▶ $tmp{lang}=$v->{lang} if exists $v->{lang};
Branch: 1 branch
BranchTrueFalseTotal
if exists $v->{"lang"} 0 0 0
105 0 ▶ push @d,[$name,$v->{msg} || '',\%tmp];
Condition0%0/2
$v->{'msg'} || ''
l!l
00
MC/DC0%0/1
$v->{'msg'} || ''
$v->{'msg'}
Truth table0%0/2
A
A= $v->{'msg'}
Aresult
11
00
106 } else
107 {
108 0 push @d,[$name,{s=>$k}];
109 }
110 }
111 0 return @d;
112 }
113  
114 0 ▶sub is_active { return shift->has_any('ok'); }
Subroutine is_active: not called CC=1 SCAR=6.9
Pod documented
115 0 ▶sub is_published { return shift->has_not(qw/clientHold serverHold inactive/); }
Subroutine is_published: not called CC=1 SCAR=6.9
Pod documented
116 0 ▶sub is_pending { return shift->has_any(qw/pendingCreate pendingDelete pendingRenew pendingTransfer pendingUpdate/); }
Subroutine is_pending: not called CC=1 SCAR=6.9
Pod documented
117 0 ▶sub is_linked { return shift->has_any('linked'); }
Subroutine is_linked: not called CC=1 SCAR=6.9
Pod documented
118 0 ▶sub is_grace { return shift->has_any(qw/addPeriod autoRenewPeriod renewPeriod transferPeriod redemptionPeriod pendingRestore pendingDelete/); } ## defined in RFC3915 ยง3.1
Subroutine is_grace: not called CC=1 SCAR=6.9
Pod documented
119  
120 0 ▶sub can_delete { my $self=shift; return (!$self->is_linked() && !$self->is_pending() && $self->has_not(qw/clientDeleteProhibited serverDeleteProhibited/))? 1 : 0; }
Subroutine can_delete: not called CC=4 SCAR=30.0
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
!($self->is_linked || $self->is_pending) && $self->has_not('clientDeleteProhibited', 'serverDeleteProhibited') ? : 0 0 0
Condition0%0/6
not $self->is_linked || $self->is_pending and $self->has_not("clientDeleteProhibited", "serverDeleteProhibited")
!ll&&!rl&&r
000
$self->is_linked || $self->is_pending
l!l&&r!l&&!r
000
MC/DC0%0/3
not $self->is_linked || $self->is_pending and $self->has_not("clientDeleteProhibited", "serverDeleteProhibited")
$self->is_linked $self->is_pending $self->has_not("clientDeleteProhibited", "serverDeleteProhibited")
Truth table0%0/4
not(A || B) and C
A= $self->is_linkedB= $self->is_pendingC= $self->has_not("clientDeleteProhibited", "serverDeleteProhibited")
ABCresult
1XX0
01X0
0000
0011
121 0 ▶sub can_renew { my $self=shift; return (!$self->is_pending() && $self->has_not(qw/clientRenewProhibited serverRenewProhibited/))? 1 : 0; }
Subroutine can_renew: not called CC=3 SCAR=24.8
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
!$self->is_pending && $self->has_not('clientRenewProhibited', 'serverRenewProhibited') ? : 0 0 0
Condition0%0/3
not $self->is_pending and $self->has_not("clientRenewProhibited", "serverRenewProhibited")
!ll&&!rl&&r
000
MC/DC0%0/2
not $self->is_pending and $self->has_not("clientRenewProhibited", "serverRenewProhibited")
not $self->is_pending $self->has_not("clientRenewProhibited", "serverRenewProhibited")
Truth table0%0/3
not(A) and B
A= not $self->is_pendingB= $self->has_not("clientRenewProhibited", "serverRenewProhibited")
ABresult
0X0
100
111
122 0 ▶sub can_update { my $self=shift; return (!$self->is_pending() && $self->has_not(qw/clientUpdateProhibited serverUpdateProhibited/))? 1 : 0; }
Subroutine can_update: not called CC=3 SCAR=24.8
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
!$self->is_pending && $self->has_not('clientUpdateProhibited', 'serverUpdateProhibited') ? : 0 0 0
Condition0%0/3
not $self->is_pending and $self->has_not("clientUpdateProhibited", "serverUpdateProhibited")
!ll&&!rl&&r
000
MC/DC0%0/2
not $self->is_pending and $self->has_not("clientUpdateProhibited", "serverUpdateProhibited")
not $self->is_pending $self->has_not("clientUpdateProhibited", "serverUpdateProhibited")
Truth table0%0/3
not(A) and B
A= not $self->is_pendingB= $self->has_not("clientUpdateProhibited", "serverUpdateProhibited")
ABresult
0X0
100
111
123 0 ▶sub can_transfer { my $self=shift; return (!$self->is_pending() && $self->has_not(qw/clientTransferProhibited serverTransferProhibited/))? 1 : 0; }
Subroutine can_transfer: not called CC=3 SCAR=24.8
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
!$self->is_pending && $self->has_not('clientTransferProhibited', 'serverTransferProhibited') ? : 0 0 0
Condition0%0/3
not $self->is_pending and $self->has_not("clientTransferProhibited", "serverTransferProhibited")
!ll&&!rl&&r
000
MC/DC0%0/2
not $self->is_pending and $self->has_not("clientTransferProhibited", "serverTransferProhibited")
not $self->is_pending $self->has_not("clientTransferProhibited", "serverTransferProhibited")
Truth table0%0/3
not(A) and B
A= not $self->is_pendingB= $self->has_not("clientTransferProhibited", "serverTransferProhibited")
ABresult
0X0
100
111
124  
125 ####################################################################################################
126 1 1;
« DRI/Protocol/EPP/Extensions/Keygroup.pm ↑ Summary DRI/Protocol/EPP/Extensions/IT/Contact.pm »