DRI/Protocol/EPP/Extensions/AFNIC/Contact.pm

filter: Statementstmt 7.3% 13 / 177 Branchbran 0.0% 0 / 130 Conditioncond 0.0% 0 / 39 MC/DCmcdc 0.0% 0 / 22 Subroutinesub 26.6% 4 / 15 Podpod 0.0% 0 / 11 totaltotal 4.3% 17 / 394 CC 83 SCAR 56.4
CC
83
Cov
4%
create
756.0
info_parse
210.0
update
132.0
CRAP 280.2
« DRI/Protocol/EPP/Extensions/CZ/Domain.pm ↑ Summary DRI/Protocol/EPP/Extensions/PL/Domain.pm »
1 ## Domain Registry Interface, AFNIC (.FR/.RE/.TF/.WF/.PM/.YT) Contact EPP extension commands
2 ##
3 ## Copyright (c) 2008,2009,2012,2013,2016,2019 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::Extensions::AFNIC::Contact;
16  
17 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 1 ▶use Net::DRI::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶use Net::DRI::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 =pod
24  
25 =head1 NAME
26  
27 Net::DRI::Protocol::EPP::Extensions::AFNIC::Contact - AFNIC (.FR/.RE/.TF/.WF/.PM/.YT) EPP Contact extensions for Net::DRI
28  
29 =head1 DESCRIPTION
30  
31 Please see the README file for details.
32  
33 =head1 SUPPORT
34  
35 For now, support questions should be sent to:
36  
37 E<lt>netdri@dotandco.comE<gt>
38  
39 Please also see the SUPPORT file in the distribution.
40  
41 =head1 SEE ALSO
42  
43 E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt>
44  
45 =head1 AUTHOR
46  
47 Patrick Mevzek, E<lt>netdri@dotandco.comE<gt>
48  
49 =head1 COPYRIGHT
50  
51 Copyright (c) 2008,2009,2012,2013,2016,2019 Patrick Mevzek <netdri@dotandco.com>.
52 All rights reserved.
53  
54 This program is free software; you can redistribute it and/or modify
55 it under the terms of the GNU General Public License as published by
56 the Free Software Foundation; either version 2 of the License, or
57 (at your option) any later version.
58  
59 See the LICENSE file that comes with this distribution for more details.
60  
61 =cut
62  
63 ####################################################################################################
64  
65 sub register_commands
66 0 ▶{
Subroutine register_commands: not called CC=1 SCAR=6.9
Pod undocumented
67 0 my ($class,$version)=@_;
68 0 my %tmp=(
69 create => [ \&create, \&create_parse ],
70 update => [ \&update, undef ],
71 info => [ undef, \&info_parse ],
72 );
73  
74 0 return { 'contact' => \%tmp };
75 }
76  
77 ####################################################################################################
78  
79 sub create
80 0 ▶{
Subroutine create: not called CC=27 SCAR=66.3
Pod undocumented
81 0 my ($epp,$contact)=@_;
82  
83 ## validate() has been called
84 0 my @n;
85 0 my $qual=$contact->qualification();
86 0 ▶ if ($contact->legal_form()) # PM
Branch: 1 branch
BranchTrueFalseTotal
if ($contact->legal_form) { } 0 0 0
87 {
88 0 my @d;
89 0 push @d,build_q_idtstatus($qual);
90  
91 0 ▶ Net::DRI::Exception::usererr_insufficient_parameters('legal_form data mandatory') unless ($contact->legal_form());
Branch: 1 branch
BranchTrueFalseTotal
unless $contact->legal_form 0 0 0
92 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('legal_form_other data mandatory if legal_form=other') if (($contact->legal_form() eq 'other') && !$contact->legal_form_other());
Branch: 1 branch
BranchTrueFalseTotal
if $contact->legal_form eq "other" and not $contact->legal_form_other 0 0 0
Condition0%0/3
$contact->legal_form eq "other" and not $contact->legal_form_other
!ll&&!rl&&r
000
MC/DC0%0/2
$contact->legal_form eq "other" and not $contact->legal_form_other
$contact->legal_form eq "other" not $contact->legal_form_other
Truth table0%0/3
A and not(B)
A= $contact->legal_form eq "other"B= not $contact->legal_form_other
ABresult
0X0
100
111
93  
94 0 ▶ push @d,['frnic:legalStatus',{'s' => $contact->legal_form()},$contact->legal_form() eq 'other'? $contact->legal_form_other() : ''];
Branch: 1 branch
BranchTrueFalseTotal
$contact->legal_form eq 'other' ? : 0 0 0
95 0 my @id;
96  
97 0 ▶ if ($contact->legal_id() && $contact->legal_id_type())
Branch: 1 branch
BranchTrueFalseTotal
if ($contact->legal_id and $contact->legal_id_type) 0 0 0
Condition0%0/3
$contact->legal_id and $contact->legal_id_type
!ll&&!rl&&r
000
MC/DC0%0/2
$contact->legal_id and $contact->legal_id_type
$contact->legal_id $contact->legal_id_type
Truth table0%0/3
A and B
A= $contact->legal_idB= $contact->legal_id_type
ABresult
0X0
100
111
98 {
99 0 ▶ push @d,['frnic:siren',$contact->legal_id()] if $contact->legal_id_type() eq 'siren';
Branch: 1 branch
BranchTrueFalseTotal
if $contact->legal_id_type eq "siren" 0 0 0
100 0 ▶ push @id,['frnic:DUNS',$contact->legal_id()] if $contact->legal_id_type() eq 'duns';
Branch: 1 branch
BranchTrueFalseTotal
if $contact->legal_id_type eq "duns" 0 0 0
101 0 ▶ push @id,['frnic:local',$contact->legal_id()] if $contact->legal_id_type() eq 'local';
Branch: 1 branch
BranchTrueFalseTotal
if $contact->legal_id_type eq "local" 0 0 0
102 }
103 0 ▶ push @d,['frnic:VAT',$contact->vat()] if $contact->vat();
Branch: 1 branch
BranchTrueFalseTotal
if $contact->vat 0 0 0
104 0 ▶ push @d,['frnic:trademark',$contact->trademark()] if $contact->trademark();
Branch: 1 branch
BranchTrueFalseTotal
if $contact->trademark 0 0 0
105 0 my $jo=$contact->jo();
106 0 ▶ if (defined($jo) && (ref($jo) eq 'HASH'))
Branch: 1 branch
BranchTrueFalseTotal
if (defined $jo and ref $jo eq "HASH") 0 0 0
Condition0%0/3
defined $jo and ref $jo eq "HASH"
!ll&&!rl&&r
000
MC/DC0%0/2
defined $jo and ref $jo eq "HASH"
defined $jo ref $jo eq "HASH"
Truth table0%0/3
A and B
A= defined $joB= ref $jo eq "HASH"
ABresult
0X0
100
111
107 {
108 0 my @j;
109 0 ▶ push @j,['frnic:waldec',$jo->{waldec}] if exists $jo->{waldec};
Branch: 1 branch
BranchTrueFalseTotal
if exists $jo->{"waldec"} 0 0 0
110 0 ▶ push @j,['frnic:waldec',$contact->legal_id()] if (defined $contact->legal_id() && defined $contact->legal_form_other() && $contact->legal_form_other() eq 'asso'); ## not sure API ok
Branch: 1 branch
BranchTrueFalseTotal
if defined $contact->legal_id and defined $contact->legal_form_other and $contact->legal_form_other eq "asso" 0 0 0
Condition0%0/6
defined $contact->legal_id and defined $contact->legal_form_other and $contact->legal_form_other eq "asso"
!ll&&!rl&&r
000
defined $contact->legal_id and defined $contact->legal_form_other
!ll&&!rl&&r
000
MC/DC0%0/3
defined $contact->legal_id and defined $contact->legal_form_other and $contact->legal_form_other eq "asso"
defined $contact->legal_id defined $contact->legal_form_other $contact->legal_form_other eq "asso"
Truth table0%0/4
A and B and C
A= defined $contact->legal_idB= defined $contact->legal_form_otherC= $contact->legal_form_other eq "asso"
ABCresult
0XX0
10X0
1100
1111
111 0 push @j,['frnic:decl',$jo->{date_declaration}];
112 0 push @j,['frnic:publ',{announce=>$jo->{number},page=>$jo->{page}},$jo->{date_publication}];
113 0 push @d,['frnic:asso',@j];
114 }
115 0 ▶ push @d,@id if @id;
Branch: 1 branch
BranchTrueFalseTotal
if @id 0 0 0
116 0 push @n,['frnic:legalEntityInfos',@d];
117 } else # PP
118 {
119 0 my @d;
120 0 push @d,build_q_idtstatus($qual);
121  
122 0 my $b=$contact->birth();
123 0 ▶ if (Net::DRI::Util::has_key($b,'date') && Net::DRI::Util::has_key($b,'place'))
Branch: 1 branch
BranchTrueFalseTotal
if (Net::DRI::Util::has_key($b, "date") and Net::DRI::Util::has_key($b, "place")) 0 0 0
Condition0%0/3
Net::DRI::Util::has_key($b, "date") and Net::DRI::Util::has_key($b, "place")
!ll&&!rl&&r
000
MC/DC0%0/2
Net::DRI::Util::has_key($b, "date") and Net::DRI::Util::has_key($b, "place")
Net::DRI::Util::has_key($b, "date") Net::DRI::Util::has_key($b, "place")
Truth table0%0/3
A and B
A= Net::DRI::Util::has_key($b, "date")B= Net::DRI::Util::has_key($b, "place")
ABresult
0X0
100
111
124 {
125 0 ▶ push @d,['frnic:birthDate',ref $b->{date} ? $b->{date}->strftime('%Y-%m-%d') : $b->{date}];
Branch: 1 branch
BranchTrueFalseTotal
ref $b->{'date'} ? : 0 0 0
126 0 ▶ if ($b->{place}=~m/^[A-Z]{2}$/i) ## country not France
Branch: 1 branch
BranchTrueFalseTotal
if ($b->{'place'} =~ /^[A-Z]{2}$/i) { } 0 0 0
127 {
128 0 push @d,['frnic:birthCc',$b->{place}];
129 } else
130 {
131 0 my @p=($b->{place}=~m/^\s*(\S.*\S)\s*,\s*(\S.+\S)\s*$/);
132 0 push @d,['frnic:birthCity',$p[1]];
133 0 push @d,['frnic:birthPc',$p[0]];
134 0 push @d,['frnic:birthCc','FR'];
135 }
136 }
137 0 ▶ if (@d)
Branch: 1 branch
BranchTrueFalseTotal
if (@d) 0 0 0
138 {
139 0 ▶ push @n,['frnic:list','restrictedPublication'] if (defined $contact->disclose() && $contact->disclose() eq 'N');
Branch: 1 branch
BranchTrueFalseTotal
if defined $contact->disclose and $contact->disclose eq "N" 0 0 0
Condition0%0/3
defined $contact->disclose and $contact->disclose eq "N"
!ll&&!rl&&r
000
MC/DC0%0/2
defined $contact->disclose and $contact->disclose eq "N"
defined $contact->disclose $contact->disclose eq "N"
Truth table0%0/3
A and B
A= defined $contact->discloseB= $contact->disclose eq "N"
ABresult
0X0
100
111
140 0 push @n,['frnic:individualInfos',@d];
141 }
142 0 push @n,['frnic:firstName',$contact->firstname()];
143 }
144  
145 0 push @n,build_q_reachable($qual);
146  
147 0 $epp->message()->command_extension('frnic', ['ext', ['create', ['contact', @n]]]);
148 0 return;
149 }
150  
151 sub create_parse
152 0 ▶{
Subroutine create_parse: not called CC=7 SCAR=40.3
Pod undocumented
153 0 my ($po,$otype,$oaction,$oname,$rinfo)=@_;
154 0 my $mes=$po->message();
155 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
156  
157 0 my $credata=$mes->get_extension('frnic','ext');
158 0 ▶ return unless defined $credata;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $credata 0 0 0
159  
160 0 my $ns=$mes->ns('frnic');
161 0 $credata=Net::DRI::Util::xml_traverse($credata,$ns,'resData','creData');
162 0 ▶ return unless defined $credata;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $credata 0 0 0
163  
164 0 $oname=$rinfo->{contact}->{$oname}->{id}; ## take into account true ID (the one returned by the registry)
165 0 foreach my $el (Net::DRI::Util::xml_list_children($credata))
166 {
167 0 my ($name,$c)=@$el;
168 0 ▶ if ($name eq 'nhStatus')
Branch: 2 branches
BranchTrueFalseTotal
if ($name eq 'nhStatus') { } 0 0 0
elsif ($name eq 'idStatus') { } 0 0 0
169 {
170 0 $rinfo->{contact}->{$oname}->{new_handle}=Net::DRI::Util::xml_parse_boolean($c->getAttribute('new'));
171 } elsif ($name eq 'idStatus')
172 {
173 0 $rinfo->{contact}->{$oname}->{qualification}={ identification => parse_q_idtstatus($po,$c) };
174 }
175 }
176 0 return;
177 }
178  
179 sub build_q_idtstatus
180 0 ▶{
Subroutine build_q_idtstatus: not called CC=3 SCAR=24.8
Pod undocumented
181 0 my ($qual)=@_;
182 0 my @d;
183 0 ▶ if (Net::DRI::Util::has_key($qual,'identification') && Net::DRI::Util::has_key($qual->{identification},'status'))
Branch: 1 branch
BranchTrueFalseTotal
if (Net::DRI::Util::has_key($qual, "identification") and Net::DRI::Util::has_key($qual->{"identification"}, "status")) 0 0 0
Condition0%0/3
Net::DRI::Util::has_key($qual, "identification") and Net::DRI::Util::has_key($qual->{"identification"}, "status")
!ll&&!rl&&r
000
MC/DC0%0/2
Net::DRI::Util::has_key($qual, "identification") and Net::DRI::Util::has_key($qual->{"identification"}, "status")
Net::DRI::Util::has_key($qual, "identification") Net::DRI::Util::has_key($qual->{"identification"}, "status")
Truth table0%0/3
A and B
A= Net::DRI::Util::has_key($qual, "identification")B= Net::DRI::Util::has_key($qual->{"identification"}, "status")
ABresult
0X0
100
111
184 {
185 0 push @d,['frnic:idStatus',$qual->{identification}->{status}];
186 }
187 0 return @d;
188 }
189  
190 sub build_q_reachable
191 0 ▶{
Subroutine build_q_reachable: not called CC=5 SCAR=34.0
Pod undocumented
192 0 my ($qual)=@_;
193 0 my @n;
194 0 ▶ if (Net::DRI::Util::has_key($qual,'reachable') && Net::DRI::Util::has_key($qual->{reachable},'value') && Net::DRI::Util::has_key($qual->{reachable},'media'))
Branch: 1 branch
BranchTrueFalseTotal
if (Net::DRI::Util::has_key($qual, "reachable") and Net::DRI::Util::has_key($qual->{"reachable"}, "value") and Net::DRI::Util::has_key($qual->{"reachable"}, "media")) 0 0 0
Condition0%0/6
Net::DRI::Util::has_key($qual, "reachable") and Net::DRI::Util::has_key($qual->{"reachable"}, "value") and Net::DRI::Util::has_key($qual->{"reachable"}, "media")
!ll&&!rl&&r
000
Net::DRI::Util::has_key($qual, "reachable") and Net::DRI::Util::has_key($qual->{"reachable"}, "value")
!ll&&!rl&&r
000
MC/DC0%0/3
Net::DRI::Util::has_key($qual, "reachable") and Net::DRI::Util::has_key($qual->{"reachable"}, "value") and Net::DRI::Util::has_key($qual->{"reachable"}, "media")
Net::DRI::Util::has_key($qual, "reachable") Net::DRI::Util::has_key($qual->{"reachable"}, "value") Net::DRI::Util::has_key($qual->{"reachable"}, "media")
Truth table0%0/4
A and B and C
A= Net::DRI::Util::has_key($qual, "reachable")B= Net::DRI::Util::has_key($qual->{"reachable"}, "value")C= Net::DRI::Util::has_key($qual->{"reachable"}, "media")
ABCresult
0XX0
10X0
1100
1111
195 {
196 0 ▶ push @n,['frnic:reachable',{media=>$qual->{reachable}->{media}},$qual->{reachable}->{value} ? 1 : 0];
Branch: 1 branch
BranchTrueFalseTotal
$qual->{'reachable'}{'value'} ? : 0 0 0
197 }
198 0 return @n;
199 }
200  
201 sub update
202 0 ▶{
Subroutine update: not called CC=11 SCAR=48.8
Pod undocumented
203 0 my ($epp,$domain,$todo)=@_;
204  
205 0 my $dadd=$todo->add('disclose');
206 0 my $ddel=$todo->del('disclose');
207 0 my $qadd=$todo->add('qualification');
208 0 my $qdel=$todo->del('qualification');
209 0 ▶ return unless ($dadd || $ddel || $qadd || $qdel);
Branch: 1 branch
BranchTrueFalseTotal
unless $dadd or $ddel or $qadd or $qdel 0 0 0
Condition0%0/9
$dadd or $ddel or $qadd or $qdel
l!l&&r!l&&!r
000
$dadd or $ddel or $qadd
l!l&&r!l&&!r
000
$dadd or $ddel
l!l&&r!l&&!r
000
MC/DC0%0/4
$dadd or $ddel or $qadd or $qdel
$dadd $ddel $qadd $qdel
Truth table0%0/5
A or B or C or D
A= $daddB= $ddelC= $qaddD= $qdel
ABCDresult
1XXX1
01XX1
001X1
00011
00000
210  
211 0 my (@add,@del);
212 0 ▶ push @add,['frnic:list',$dadd] if $dadd;
Branch: 1 branch
BranchTrueFalseTotal
if $dadd 0 0 0
213 0 ▶ push @del,['frnic:list',$ddel] if $ddel;
Branch: 1 branch
BranchTrueFalseTotal
if $ddel 0 0 0
214  
215 0 ▶ if ($qadd)
Branch: 1 branch
BranchTrueFalseTotal
if ($qadd) 0 0 0
216 {
217 0 push @add,build_q_idtstatus($qadd);
218 0 push @add,build_q_reachable($qadd);
219 }
220 0 ▶ if ($qdel)
Branch: 1 branch
BranchTrueFalseTotal
if ($qdel) 0 0 0
221 {
222 0 push @del,build_q_idtstatus($qdel);
223 0 push @del,build_q_reachable($qdel);
224 }
225  
226 0 my @n;
227 0 ▶ push @n,['frnic:add',@add] if @add;
Branch: 1 branch
BranchTrueFalseTotal
if @add 0 0 0
228 0 ▶ push @n,['frnic:rem',@del] if @del;
Branch: 1 branch
BranchTrueFalseTotal
if @del 0 0 0
229  
230 0 $epp->message()->command_extension('frnic', ['ext', ['update', ['contact', @n]]]);
231 0 return;
232 }
233  
234 sub parse_q_idtstatus
235 0 ▶{
Subroutine parse_q_idtstatus: not called CC=3 SCAR=24.8
Pod undocumented
236 0 my ($po,$c)=@_;
237 0 my %i;
238 0 ▶ $i{when}=$po->parse_iso8601($c->getAttribute('when')) if $c->hasAttribute('when');
Branch: 1 branch
BranchTrueFalseTotal
if $c->hasAttribute("when") 0 0 0
239 0 ▶ $i{source}=$c->getAttribute('source') if $c->hasAttribute('source');
Branch: 1 branch
BranchTrueFalseTotal
if $c->hasAttribute("source") 0 0 0
240 0 $i{value}=$c->textContent();
241 0 return \%i;
242 }
243  
244 sub parse_q_reachable
245 0 ▶{
Subroutine parse_q_reachable: not called CC=4 SCAR=30.0
Pod undocumented
246 0 my ($po,$c)=@_;
247 0 my %r;
248 0 ▶ $r{when}=$po->parse_iso8601($c->getAttribute('when')) if $c->hasAttribute('when');
Branch: 1 branch
BranchTrueFalseTotal
if $c->hasAttribute("when") 0 0 0
249 0 ▶ $r{media}=$c->getAttribute('media') if $c->hasAttribute('media');
Branch: 1 branch
BranchTrueFalseTotal
if $c->hasAttribute("media") 0 0 0
250 0 ▶ $r{source}=$c->getAttribute('source') if $c->hasAttribute('source');
Branch: 1 branch
BranchTrueFalseTotal
if $c->hasAttribute("source") 0 0 0
251 0 $r{value}=Net::DRI::Util::xml_parse_boolean($c->textContent());
252 0 return \%r;
253 }
254  
255 sub info_parse
256 0 ▶{
Subroutine info_parse: not called CC=14 SCAR=53.5
Pod undocumented
257 0 my ($po,$otype,$oaction,$oname,$rinfo)=@_;
258 0 my $mes=$po->message();
259 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
260  
261 0 my $infdata=$mes->get_extension('frnic','ext');
262 0 ▶ return unless defined $infdata;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $infdata 0 0 0
263  
264 0 my $ns=$mes->ns('frnic');
265 0 $infdata=Net::DRI::Util::xml_traverse($infdata,$ns,'resData','infData','contact');
266 0 ▶ return unless defined $infdata;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $infdata 0 0 0
267  
268 0 my $co=$rinfo->{contact}->{$oname}->{self};
269 0 my %q;
270 0 foreach my $el (Net::DRI::Util::xml_list_children($infdata))
271 {
272 0 my ($name,$c)=@$el;
273 0 ▶ if ($name eq 'firstName')
Branch: 6 branches
BranchTrueFalseTotal
if ($name eq 'firstName') { } 0 0 0
elsif ($name eq 'list') { } 0 0 0
elsif ($name eq 'individualInfos') { } 0 0 0
elsif ($name eq 'legalEntityInfos') { } 0 0 0
elsif ($name eq 'obsoleted') { } 0 0 0
elsif ($name eq 'reachable') { } 0 0 0
274 {
275 0 $co->firstname($c->textContent());
276 } elsif ($name eq 'list')
277 {
278 0 ▶ $co->disclose($c->textContent() eq 'restrictedPublication'? 'N' : 'Y');
Branch: 1 branch
BranchTrueFalseTotal
$c->textContent eq 'restrictedPublication' ? : 0 0 0
279 } elsif ($name eq 'individualInfos')
280 {
281 0 parse_individualinfos($po,$otype,$oaction,$oname,$rinfo,$c,$co,$mes,\%q);
282 } elsif ($name eq 'legalEntityInfos')
283 {
284 0 parse_legalentityinfos($po,$otype,$oaction,$oname,$rinfo,$c,$co,$mes,\%q);
285 } elsif ($name eq 'obsoleted')
286 {
287 0 my %o;
288 0 $o{value}=Net::DRI::Util::xml_parse_boolean($c->textContent());
289 0 ▶ $o{when}=$po->parse_iso8601($c->getAttribute('when')) if $c->hasAttribute('when');
Branch: 1 branch
BranchTrueFalseTotal
if $c->hasAttribute("when") 0 0 0
290 0 $co->obsoleted(\%o);
291 } elsif ($name eq 'reachable')
292 {
293 0 $q{reachable}=parse_q_reachable($po,$c);
294 }
295 }
296 0 ▶ $co->qualification(\%q) if %q;
Branch: 1 branch
BranchTrueFalseTotal
if %q 0 0 0
297  
298 0 return;
299 }
300  
301 sub parse_individualinfos
302 0 ▶{
Subroutine parse_individualinfos: not called CC=8 SCAR=42.8
Pod undocumented
303 0 my ($po,$otype,$oaction,$oname,$rinfo,$c,$co,$mes,$rq)=@_;
304  
305 0 my %birth;
306 0 foreach my $sel (Net::DRI::Util::xml_list_children($c))
307 {
308 0 my ($nn,$cc)=@$sel;
309 0 ▶ if ($nn eq 'idStatus')
Branch: 5 branches
BranchTrueFalseTotal
if ($nn eq 'idStatus') { } 0 0 0
elsif ($nn eq 'birthDate') { } 0 0 0
elsif ($nn eq 'birthCity') { } 0 0 0
elsif ($nn eq 'birthPc') { } 0 0 0
elsif ($nn eq 'birthCc') { } 0 0 0
310 {
311 0 $rq->{identification}=parse_q_idtstatus($po,$c);
312 } elsif ($nn eq 'birthDate')
313 {
314 0 $birth{date}=$cc->textContent();
315 } elsif ($nn eq 'birthCity')
316 {
317 0 $birth{place}=$cc->textContent();
318 } elsif ($nn eq 'birthPc')
319 {
320 0 $birth{place}=sprintf('%s, %s',$cc->textContent(),$birth{place});
321 } elsif ($nn eq 'birthCc')
322 {
323 0 my $v=$cc->textContent();
324 0 ▶ $birth{place}=$v unless ($v eq 'FR');
Branch: 1 branch
BranchTrueFalseTotal
unless $v eq "FR" 0 0 0
325 }
326 }
327 0 $co->birth(\%birth);
328  
329 0 return;
330 }
331  
332 sub parse_legalentityinfos
333 0 ▶{
Subroutine parse_legalentityinfos: not called CC=10 SCAR=47.0
Pod undocumented
334 0 my ($po,$otype,$oaction,$oname,$rinfo,$c,$co,$mes,$rq)=@_;
335  
336 0 foreach my $sel (Net::DRI::Util::xml_list_children($c))
337 {
338 0 my ($nn,$cc)=@$sel;
339 0 ▶ if ($nn eq 'idStatus')
Branch: 5 branches
BranchTrueFalseTotal
if ($nn eq 'idStatus') { } 0 0 0
elsif ($nn eq 'legalStatus') { } 0 0 0
elsif ($nn =~ /^(?:siren|DUNS|local)$/) { } 0 0 0
elsif ($nn eq 'trademark') { } 0 0 0
elsif ($nn eq 'asso') { } 0 0 0
340 {
341 0 $rq->{identification}=parse_q_idtstatus($po,$cc);
342 } elsif ($nn eq 'legalStatus')
343 {
344 0 $co->legal_form($cc->getAttribute('s'));
345 0 my $v=$cc->textContent();
346 0 ▶ $co->legal_form_other($v) if $v;
Branch: 1 branch
BranchTrueFalseTotal
if $v 0 0 0
347 } elsif ($nn=~m/^(?:siren|DUNS|local)$/)
348 {
349 0 $co->legal_id($cc->textContent());
350 0 $co->legal_id_type(lc $nn);
351 } elsif ($nn eq 'trademark')
352 {
353 0 $co->trademark($cc->textContent());
354 } elsif ($nn eq 'asso')
355 {
356 0 my %jo;
357 0 my $ccc=$cc->getChildrenByTagNameNS($mes->ns('frnic'),'decl');
358 0 ▶ $jo{date_declaration}=$ccc->get_node(1)->textContent() if $ccc->size();
Branch: 1 branch
BranchTrueFalseTotal
if $ccc->size 0 0 0
359 0 $ccc=$cc->getChildrenByTagNameNS($mes->ns('frnic'),'publ');
360 0 ▶ if ($ccc->size())
Branch: 1 branch
BranchTrueFalseTotal
if ($ccc->size) 0 0 0
361 {
362 0 my $p=$ccc->get_node(1);
363 0 $jo{number}=$p->getAttribute('announce');
364 0 $jo{page}=$p->getAttribute('page');
365 0 $jo{date_publication}=$p->textContent();
366 }
367 0 $co->jo(\%jo);
368 }
369 }
370  
371 0 return;
372 }
373  
374 ####################################################################################################
375 1 1;
« DRI/Protocol/EPP/Extensions/CZ/Domain.pm ↑ Summary DRI/Protocol/EPP/Extensions/PL/Domain.pm »