DRI/DRD/RESTENA.pm

filter: Statementstmt 34.3% 23 / 67 Branchbran 4.5% 1 / 22 Conditioncond 0.0% 0 / 9 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 36.3% 8 / 22 Podpod 23.5% 4 / 17 totaltotal 25.1% 36 / 143 CC 15 SCAR 42.1
CC
15
Cov
24%
domain_status_allows
182.0
transport_protocol_default
5.2
periods
2.0
CRAP 67.1
« DRI/DRD/TCI.pm ↑ Summary DRI/Protocol/EPP/Extensions/Afilias/Trademark.pm »
1 ## Domain Registry Interface, RESTENA (.LU) policy from DocRegistrar-2.0.6.pdf
2 ##
3 ## Copyright (c) 2007-2011,2013,2016 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::DRD::RESTENA;
16  
17 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 2 ▶use base qw/Net::DRI::DRD/;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 2 ▶use Net::DRI::Data::Contact::LU;
Subroutine BEGIN: called CC=1 SCAR=0.0
23  
24 2 __PACKAGE__->make_exception_for_unavailable_operations(qw/domain_renew domain_transfer_accept domain_transfer_refuse contact_transfer contact_transfer_start contact_transfer_stop contact_transfer_query contact_transfer_accept contact_transfer_refuse/);
25  
26 =pod
27  
28 =head1 NAME
29  
30 Net::DRI::DRD::RESTENA - RESTENA (.LU) policies for Net::DRI
31  
32 =head1 DESCRIPTION
33  
34 Please see the README file for details.
35  
36 =head1 SUPPORT
37  
38 For now, support questions should be sent to:
39  
40 E<lt>netdri@dotandco.comE<gt>
41  
42 Please also see the SUPPORT file in the distribution.
43  
44 =head1 SEE ALSO
45  
46 E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt>
47  
48 =head1 AUTHOR
49  
50 Patrick Mevzek, E<lt>netdri@dotandco.comE<gt>
51  
52 =head1 COPYRIGHT
53  
54 Copyright (c) 2007-2011,2013,2016 Patrick Mevzek <netdri@dotandco.com>.
55 All rights reserved.
56  
57 This program is free software; you can redistribute it and/or modify
58 it under the terms of the GNU General Public License as published by
59 the Free Software Foundation; either version 2 of the License, or
60 (at your option) any later version.
61  
62 See the LICENSE file that comes with this distribution for more details.
63  
64 =cut
65  
66 ####################################################################################################
67  
68 sub new
69 {
70 1 ▶ my $class=shift;
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
71 1 my $self=$class->SUPER::new(@_);
72 1 $self->{info}->{host_as_attr}=0;
73 1 $self->{info}->{contact_i18n}=1; ## LOC only
74 1 return $self;
75 }
76  
77 0 ▶sub periods { return; } ## registry does not expect any duration at all
Subroutine periods: not called CC=1 SCAR=6.9
Pod documented
78 1 ▶sub name { return 'RESTENA'; }
Subroutine name: called CC=1 SCAR=0.0
Pod documented
79 1 ▶sub tlds { return ('lu'); }
Subroutine tlds: called CC=1 SCAR=0.0
Pod documented
80 0 ▶sub object_types { return ('domain','contact','ns'); }
Subroutine object_types: not called CC=1 SCAR=6.9
Pod documented
81 0 ▶sub profile_types { return qw/epp whois/; }
Subroutine profile_types: not called CC=1 SCAR=6.9
Pod undocumented
82  
83 sub transport_protocol_default
84 {
85 1 ▶ my ($self,$type)=@_;
Subroutine transport_protocol_default: called CC=3 SCAR=16.5
Pod undocumented
86  
87 1 ▶ return ('Net::DRI::Transport::Socket',{},'Net::DRI::Protocol::EPP::Extensions::LU',{}) if $type eq 'epp';
Branch: 1 branch
BranchTrueFalseTotal
if $type eq "epp" 1 0 1
88 0 ▶ return ('Net::DRI::Transport::Socket',{remote_host=>'whois.dns.lu'},'Net::DRI::Protocol::Whois',{}) if $type eq 'whois';
Branch: 1 branch
BranchTrueFalseTotal
if $type eq "whois" 0 0 0
89 0 return;
90 }
91  
92 sub set_factories
93 {
94 0 ▶ my ($self,$po)=@_;
Subroutine set_factories: not called CC=1 SCAR=6.9
Pod undocumented
95 0 ▶ $po->factories('contact',sub { return Net::DRI::Data::Contact::LU->new(@_); });
Subroutine __ANON__: not called CC=1 SCAR=6.9
96 0 return;
97 }
98  
99 ####################################################################################################
100  
101 sub verify_name_domain
102 {
103 0 ▶ my ($self,$ndr,$domain,$op)=@_;
Subroutine verify_name_domain: not called CC=1 SCAR=6.9
Pod undocumented
104 0 return $self->_verify_name_rules($domain,$op,{check_name => 1,
105 my_tld => 1,
106 min_length => 3,
107 no_double_hyphen => 1,
108 });
109 }
110  
111 sub domain_status_allows
112 {
113 0 ▶ my ($self,$ndr,$domain,$what,$rd)=@_;
Subroutine domain_status_allows: not called CC=13 SCAR=52.0
Pod undocumented
114  
115 0 ▶ return 0 unless ($what=~m/^(?:delete|update|transfer|renew|trade|transfer-trade|transfer-restore)$/);
Branch: 1 branch
BranchTrueFalseTotal
unless $what =~ /^(?:delete|update|transfer|renew|trade|transfer-trade|transfer-restore)$/ 0 0 0
116 0 my $s=$self->domain_current_status($ndr,$domain,$rd);
117 0 ▶ return 0 unless (defined($s));
Branch: 1 branch
BranchTrueFalseTotal
unless defined $s 0 0 0
118  
119 0 ▶ return !$s->is_pending() && $s->can_delete() if ($what eq 'delete');
Branch: 1 branch
BranchTrueFalseTotal
if $what eq "delete" 0 0 0
Condition0%0/3
!$s->is_pending && $s->can_delete
!ll&&!rl&&r
000
MC/DC0%0/2
!$s->is_pending && $s->can_delete
!$s->is_pending $s->can_delete
Truth table0%0/3
not(A) && B
A= !$s->is_pendingB= $s->can_delete
ABresult
0X0
100
111
120 0 ▶ return !$s->is_pending() && $s->can_update() if ($what eq 'update'); ## no pendingCreate pendingUpdate pendingDelete
Branch: 1 branch
BranchTrueFalseTotal
if $what eq "update" 0 0 0
Condition0%0/3
!$s->is_pending && $s->can_update
!ll&&!rl&&r
000
MC/DC0%0/2
!$s->is_pending && $s->can_update
!$s->is_pending $s->can_update
Truth table0%0/3
not(A) && B
A= !$s->is_pendingB= $s->can_update
ABresult
0X0
100
111
121 0 ▶ return $s->can_transfer() if ($what eq 'transfer');
Branch: 1 branch
BranchTrueFalseTotal
if $what eq "transfer" 0 0 0
122 0 ▶ return 0 if ($what eq 'renew');
Branch: 1 branch
BranchTrueFalseTotal
if $what eq "renew" 0 0 0
123 0 ▶ return $s->has_not('serverTradeProhibited','pendingCreate','pendingDelete') if ($what eq 'trade');
Branch: 1 branch
BranchTrueFalseTotal
if $what eq "trade" 0 0 0
124 0 ▶ return $s->has_not('serverTransferProhibited','serverTradeProhibited') if ($what eq 'transfer-trade');
Branch: 1 branch
BranchTrueFalseTotal
if $what eq "transfer-trade" 0 0 0
125 0 ▶ return $s->has_not('serverTransferProhibited','serverRestoreProhibited') && $s->has_any('pendingDelete') if ($what eq 'transfer-restore');
Branch: 1 branch
BranchTrueFalseTotal
if $what eq "transfer-restore" 0 0 0
Condition0%0/3
$s->has_not('serverTransferProhibited', 'serverRestoreProhibited') && $s->has_any('pendingDelete')
!ll&&!rl&&r
000
MC/DC0%0/2
$s->has_not('serverTransferProhibited', 'serverRestoreProhibited') && $s->has_any('pendingDelete')
$s->has_not('serverTransferProhibited', 'serverRestoreProhibited') $s->has_any('pendingDelete')
Truth table0%0/3
A && B
A= $s->has_not('serverTransferProhibited', 'serverRestoreProhibited')B= $s->has_any('pendingDelete')
ABresult
0X0
100
111
126 0 return 0; ## failsafe
127 }
128  
129 sub domain_restore
130 {
131 0 ▶ my ($self,$ndr,$domain)=@_;
Subroutine domain_restore: not called CC=1 SCAR=6.9
Pod undocumented
132 0 $self->enforce_domain_name_constraints($ndr,$domain,'restore');
133 0 return $ndr->process('domain','restore',[$domain]);
134 }
135  
136 sub domain_transfer_trade_start
137 {
138 0 ▶ my ($self,$ndr,$domain,$rd)=@_;
Subroutine domain_transfer_trade_start: not called CC=1 SCAR=6.9
Pod undocumented
139 0 $self->enforce_domain_name_constraints($ndr,$domain,'transfer_trade');
140 0 return $ndr->process('domain','transfer_trade_request',[$domain,$rd]);
141 }
142  
143 sub domain_transfer_trade_query
144 {
145 0 ▶ my ($self,$ndr,$domain)=@_;
Subroutine domain_transfer_trade_query: not called CC=1 SCAR=6.9
Pod undocumented
146 0 $self->enforce_domain_name_constraints($ndr,$domain,'transfer_trade');
147 0 return $ndr->process('domain','transfer_trade_query',[$domain]);
148 }
149  
150 sub domain_transfer_trade_stop
151 {
152 0 ▶ my ($self,$ndr,$domain)=@_;
Subroutine domain_transfer_trade_stop: not called CC=1 SCAR=6.9
Pod undocumented
153 0 $self->enforce_domain_name_constraints($ndr,$domain,'transfer_trade');
154 0 return $ndr->process('domain','transfer_trade_cancel',[$domain]);
155 }
156  
157 sub domain_transfer_restore_start
158 {
159 0 ▶ my ($self,$ndr,$domain,$rd)=@_;
Subroutine domain_transfer_restore_start: not called CC=1 SCAR=6.9
Pod undocumented
160 0 $self->enforce_domain_name_constraints($ndr,$domain,'transfer_restore');
161 0 return $ndr->process('domain','transfer_restore_request',[$domain,$rd]);
162 }
163  
164 sub domain_transfer_restore_query
165 {
166 0 ▶ my ($self,$ndr,$domain)=@_;
Subroutine domain_transfer_restore_query: not called CC=1 SCAR=6.9
Pod undocumented
167 0 $self->enforce_domain_name_constraints($ndr,$domain,'transfer_restore');
168 0 return $ndr->process('domain','transfer_restore_query',[$domain]);
169 }
170  
171 sub domain_transfer_restore_stop
172 {
173 0 ▶ my ($self,$ndr,$domain)=@_;
Subroutine domain_transfer_restore_stop: not called CC=1 SCAR=6.9
Pod undocumented
174 0 $self->enforce_domain_name_constraints($ndr,$domain,'transfer_restore');
175 0 return $ndr->process('domain','transfer_restore_cancel',[$domain]);
176 }
177  
178 ####################################################################################################
179 2 1;
« DRI/DRD/TCI.pm ↑ Summary DRI/Protocol/EPP/Extensions/Afilias/Trademark.pm »