DRI/Protocol/EPP/Extensions/AT/Result.pm

filter: Statementstmt 37.8% 14 / 37 Branchbran 0.0% 0 / 14 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 66.6% 4 / 6 Podpod 0.0% 0 / 2 totaltotal 28.1% 18 / 64 CC 10 SCAR 43.0
CC
10
Cov
26%
condition_parse
110.0
register_commands
2.0
BEGIN
1.0
CRAP 73.7
« DRI/Protocol/EPP/Extensions/NO/Result.pm ↑ Summary DRI/Protocol/EPP/Extensions/SE/Extensions.pm »
1 ## Domain Registry Interface, ENUM.AT Result Condition
2 ## Contributed by Michael Braunoeder from ENUM.AT <michael.braunoeder@enum.at>
3 ##
4 ## Copyright (c) 2006,2007,2013 Patrick Mevzek <netdri@dotandco.com>. All rights reserved.
5 ##
6 ## This file is part of Net::DRI
7 ##
8 ## Net::DRI is free software; you can redistribute it and/or modify
9 ## it under the terms of the GNU General Public License as published by
10 ## the Free Software Foundation; either version 2 of the License, or
11 ## (at your option) any later version.
12 ##
13 ## See the LICENSE file that comes with this distribution for more details.
14 ####################################################################################################
15  
16 package Net::DRI::Protocol::EPP::Extensions::AT::Result;
17  
18 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 1 ▶use Net::DRI::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 ▶use Net::DRI::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
23  
24 1 our $NS='http://www.enum.at/rxsd/ienum43-result-1.0';
25  
26 =pod
27  
28 =head1 NAME
29  
30 Net::DRI::Protocol::EPP::Extensions::AT::Result - ENUM.AT Result Condition EPP Mapping 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) 2006,2007,2013 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 register_commands
69 {
70 0 ▶ my ($class,$version)=@_;
Subroutine register_commands: not called CC=1 SCAR=6.9
Pod undocumented
71 0 my %tmp=(
72 login => [ undef, \&condition_parse ],
73 check => [ undef, \&condition_parse ],
74 info => [ undef, \&condition_parse ],
75 transfer_query => [ undef, \&condition_parse ],
76 create => [ undef, \&condition_parse ],
77 delete => [ undef, \&condition_parse],
78 transfer_request => [ undef, \&condition_parse ],
79 transfer_cancel => [ undef,\&condition_parse ],
80 transfer_answer => [ undef,\&condition_parse ],
81 update => [ undef, \&condition_parse ],
82 );
83  
84 0 return { 'domain' => \%tmp };
85 }
86  
87  
88 sub condition_parse
89 {
90 0 ▶ my ($po,$otype,$oaction,$oname,$rinfo)=@_;
Subroutine condition_parse: not called CC=10 SCAR=47.0
Pod undocumented
91 0 my $mes=$po->message();
92  
93 0 my $condata=$mes->get_extension($NS,'conditions');
94 0 ▶ return unless $condata;
Branch: 1 branch
BranchTrueFalseTotal
unless $condata 0 0 0
95  
96 0 my @conditions;
97  
98 0 foreach my $el ($condata->getElementsByTagNameNS($NS,'condition'))
99 {
100 0 my %con;
101 0 my $c=$el->getFirstChild();
102  
103 0 ▶ $con{code}=$el->getAttribute('code') if $el->getAttribute('code');
Branch: 1 branch
BranchTrueFalseTotal
if $el->getAttribute("code") 0 0 0
104 0 ▶ $con{severity}=$el->getAttribute('severity') if $el->getAttribute('severity');
Branch: 1 branch
BranchTrueFalseTotal
if $el->getAttribute("severity") 0 0 0
105  
106 0 ▶ while ($c)
Branch: 1 branch
BranchTrueFalseTotal
if ($c) 0 0 0
107 {
108 0 ▶ next unless ($c->nodeType() == 1); ## only for element nodes
Branch: 1 branch
BranchTrueFalseTotal
unless $c->nodeType == 1 0 0 0
109 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
110 0 ▶ next unless $name;
Branch: 1 branch
BranchTrueFalseTotal
unless $name 0 0 0
111 0 ▶ if ($name=~m/^(msg|details)$/)
Branch: 1 branch
BranchTrueFalseTotal
if ($name =~ /^(msg|details)$/) 0 0 0
112 {
113 0 $con{$1}=$c->getFirstChild()->getData();
114 }
115 0 } continue { $c=$c->getNextSibling(); }
116 0 push @conditions,\%con;
117 }
118  
119 0 $rinfo->{domain}->{$oname}->{conditions}=\@conditions;
120 0 return;
121 }
122  
123 ####################################################################################################
124 1 1;
« DRI/Protocol/EPP/Extensions/NO/Result.pm ↑ Summary DRI/Protocol/EPP/Extensions/SE/Extensions.pm »