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

filter: Statementstmt 35.7% 10 / 28 Branchbran 0.0% 0 / 12 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 50.0% 3 / 6 Podpod 0.0% 0 / 3 totaltotal 22.0% 13 / 59 CC 9 SCAR 37.5
CC
9
Cov
22%
info_parse
72.0
create
6.0
register_commands
2.0
CRAP 42.4
« DRI/Protocol/EPP/Extensions/AFNIC/Domain.pm ↑ Summary DRI/Protocol/EPP/Extensions/NSgroup.pm »
1 ## Domain Registry Interface, ARNES (.SI) Contact EPP extension commands
2 ##
3 ## Copyright (c) 2008,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::ARNES::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 1 ▶use feature 'state';
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 =pod
22  
23 =head1 NAME
24  
25 Net::DRI::Protocol::EPP::Extensions::ARNES::Contact - ARNES (.SI) EPP Contact extensions for Net::DRI
26  
27 =head1 DESCRIPTION
28  
29 Please see the README file for details.
30  
31 =head1 SUPPORT
32  
33 For now, support questions should be sent to:
34  
35 E<lt>netdri@dotandco.comE<gt>
36  
37 Please also see the SUPPORT file in the distribution.
38  
39 =head1 SEE ALSO
40  
41 E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt>
42  
43 =head1 AUTHOR
44  
45 Patrick Mevzek, E<lt>netdri@dotandco.comE<gt>
46  
47 =head1 COPYRIGHT
48  
49 Copyright (c) 2008,2013,2016,2019 Patrick Mevzek <netdri@dotandco.com>.
50 All rights reserved.
51  
52 This program is free software; you can redistribute it and/or modify
53 it under the terms of the GNU General Public License as published by
54 the Free Software Foundation; either version 2 of the License, or
55 (at your option) any later version.
56  
57 See the LICENSE file that comes with this distribution for more details.
58  
59 =cut
60  
61 ####################################################################################################
62  
63 sub register_commands
64 0 ▶{
Subroutine register_commands: not called CC=1 SCAR=6.9
Pod undocumented
65 0 my ($class,$version)=@_;
66 0 state $rcmds = { 'contact' => { 'create' => [ \&create, undef ],
67 'info' => [ undef, \&info_parse ],
68 },
69 };
70 0 return $rcmds;
71 }
72  
73 ####################################################################################################
74  
75 sub create
76 0 ▶{
Subroutine create: not called CC=2 SCAR=17.9
Pod undocumented
77 0 my ($epp,$contact)=@_;
78  
79 # validate() has been called
80 0 ▶ return unless $contact->ctype();
Branch: 1 branch
BranchTrueFalseTotal
unless $contact->ctype 0 0 0
81  
82 0 $epp->message()->command_extension('dnssi', ['ext', ['create', ['contact',{type=>$contact->ctype()}]]]);
83 0 return;
84 }
85  
86 sub info_parse
87 0 ▶{
Subroutine info_parse: not called CC=8 SCAR=42.8
Pod undocumented
88 0 my ($po,$otype,$oaction,$oname,$rinfo)=@_;
89 0 my $mes=$po->message();
90 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
91  
92 0 my $infdata=$mes->get_extension('dnssi','ext');
93 0 ▶ return unless $infdata;
Branch: 1 branch
BranchTrueFalseTotal
unless $infdata 0 0 0
94  
95 0 $infdata=$infdata->getChildrenByTagNameNS($mes->ns('dnssi'),'info');
96 0 ▶ return unless ($infdata && $infdata->size()==1);
Branch: 1 branch
BranchTrueFalseTotal
unless $infdata and $infdata->size == 1 0 0 0
Condition0%0/3
$infdata and $infdata->size == 1
!ll&&!rl&&r
000
MC/DC0%0/2
$infdata and $infdata->size == 1
$infdata $infdata->size == 1
Truth table0%0/3
A and B
A= $infdataB= $infdata->size == 1
ABresult
0X0
100
111
97 0 $infdata=$infdata->get_node(1)->getChildrenByTagNameNS($mes->ns('dnssi'),'contact');
98 0 ▶ return unless ($infdata && $infdata->size()==1);
Branch: 1 branch
BranchTrueFalseTotal
unless $infdata and $infdata->size == 1 0 0 0
Condition0%0/3
$infdata and $infdata->size == 1
!ll&&!rl&&r
000
MC/DC0%0/2
$infdata and $infdata->size == 1
$infdata $infdata->size == 1
Truth table0%0/3
A and B
A= $infdataB= $infdata->size == 1
ABresult
0X0
100
111
99  
100 0 ▶ $rinfo->{contact}->{$oname}->{self}->ctype($1) if $infdata->get_node(1)->getAttribute('type')=~m/^(org|person)$/;
Branch: 1 branch
BranchTrueFalseTotal
if $infdata->get_node(1)->getAttribute("type") =~ /^(org|person)$/ 0 0 0
101  
102 0 return;
103 }
104  
105 ####################################################################################################
106 1 1;
« DRI/Protocol/EPP/Extensions/AFNIC/Domain.pm ↑ Summary DRI/Protocol/EPP/Extensions/NSgroup.pm »