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

filter: Statementstmt 37.1% 13 / 35 Branchbran 0.0% 0 / 16 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 66.6% 4 / 6 Podpod 0.0% 0 / 2 totaltotal 24.6% 17 / 69 CC 11 SCAR 45.1
CC
11
Cov
23%
info_parse
132.0
register_commands
2.0
BEGIN
1.0
CRAP 91.1
« DRI/Protocol/EPP/Extensions/VeriSign/WhoWas.pm ↑ Summary DRI/Data/Contact/OpenSRS.pm »
1 ## Domain Registry Interface, .AERO Contact EPP extension commands
2 ##
3 ## Copyright (c) 2006-2008,2013 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::AERO::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 DateTime::Format::ISO8601;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 =pod
24  
25 =head1 NAME
26  
27 Net::DRI::Protocol::EPP::Extensions::AERO::Contact - .AERO EPP Contact extension commands 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) 2006-2008,2013 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 {
67 0 ▶ my ($class,$version)=@_;
Subroutine register_commands: not called CC=1 SCAR=6.9
Pod undocumented
68 0 my %tmp=(
69 info => [ undef, \&info_parse ],
70 );
71  
72 0 return { 'contact' => \%tmp };
73 }
74  
75 ####################################################################################################
76  
77 sub info_parse
78 {
79 0 ▶ my ($po,$otype,$oaction,$oname,$rinfo)=@_;
Subroutine info_parse: not called CC=11 SCAR=48.8
Pod undocumented
80 0 my $mes=$po->message();
81 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
82  
83 0 my $infdata=$mes->get_extension('aero','infData');
84 0 ▶ return unless $infdata;
Branch: 1 branch
BranchTrueFalseTotal
unless $infdata 0 0 0
85  
86 0 my $c=$infdata->getChildrenByTagNameNS($mes->ns('aero'),'ensInfo');
87 0 ▶ return unless ($c && $c->size()==1);
Branch: 1 branch
BranchTrueFalseTotal
unless $c and $c->size == 1 0 0 0
Condition0%0/3
$c and $c->size == 1
!ll&&!rl&&r
000
MC/DC0%0/2
$c and $c->size == 1
$c $c->size == 1
Truth table0%0/3
A and B
A= $cB= $c->size == 1
ABresult
0X0
100
111
88 0 $c=$c->shift()->getFirstChild();
89  
90 0 my %ens;
91 0 ▶ while($c)
Branch: 1 branch
BranchTrueFalseTotal
if ($c) 0 0 0
92 {
93 0 ▶ next unless ($c->nodeType() == 1); ## only for element nodes
Branch: 1 branch
BranchTrueFalseTotal
unless $c->nodeType == 1 0 0 0
94 0 ▶ my $name=$c->localname() || $c->nodeName();
Condition0%0/3
$c->localname || $c->nodeName
l!l&&r!l&&!r
000
MC/DC0%0/2
$c->localname || $c->nodeName
$c->localname $c->nodeName
Truth table0%0/3
A || B
A= $c->localnameB= $c->nodeName
ABresult
1X1
011
000
95 0 ▶ next unless $name;
Branch: 1 branch
BranchTrueFalseTotal
unless $name 0 0 0
96  
97 0 ▶ if (my ($tag)=($name=~m/^(\S+)$/))
Branch: 1 branch
BranchTrueFalseTotal
if (my($tag) = $name =~ /^(\S+)$/) 0 0 0
98 {
99 0 $ens{Net::DRI::Util::remcam($tag)}=$c->getFirstChild()->getData();
100 }
101  
102 0 } continue { $c=$c->getNextSibling(); }
103  
104 0 ▶ $ens{last_checked_date}=DateTime::Format::ISO8601->new()->parse_datetime($ens{last_checked_date}) if exists($ens{last_checked_date});
Branch: 1 branch
BranchTrueFalseTotal
if exists $ens{"last_checked_date"} 0 0 0
105  
106 0 $rinfo->{contact}->{$oname}->{self}->ens(\%ens);
107 0 return;
108 }
109  
110 ####################################################################################################
111 1 1;
« DRI/Protocol/EPP/Extensions/VeriSign/WhoWas.pm ↑ Summary DRI/Data/Contact/OpenSRS.pm »