DRI/DRD/NicAT.pm

filter: Statementstmt 45.3% 29 / 64 Branchbran 12.5% 1 / 8 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 47.6% 10 / 21 Podpod 28.5% 4 / 14 totaltotal 39.2% 44 / 112 CC 6 SCAR 15.7
CC
6
Cov
40%
message_count
20.0
transport_protocol_default
5.2
periods
2.0
CRAP 4.8
« DRI/DRD/VeriSign/NAME.pm ↑ Summary DRI/Protocol/Whois/Domain/COM.pm »
1 ## Domain Registry Interface, NIC.AT (.AT) policy
2 ## Contributed by Michael Braunoeder from NIC.AT <mib@nic.at>
3 ##
4 ## Copyright (c) 2006-2011,2013,2016 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::DRD::NicAT;
17  
18 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 2 ▶use base qw/Net::DRI::DRD/;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 2 ▶use DateTime::Duration;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 2 ▶use Net::DRI::Data::Contact::AT;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 2 ▶use Net::DRI::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
26  
27 2 __PACKAGE__->make_exception_for_unavailable_operations(qw/domain_transfer_accept domain_transfer_refuse domain_renew contact_transfer_stop contact_transfer_query contact_transfer_accept contact_transfer_refuse contact_check/);
28  
29 =pod
30  
31 =head1 NAME
32  
33 Net::DRI::DRD::NicAT - NIC.AT (.AT) policies for Net::DRI
34  
35 =head1 DESCRIPTION
36  
37 Please see the README file for details.
38  
39 =head1 SUPPORT
40  
41 For now, support questions should be sent to:
42  
43 E<lt>netdri@dotandco.comE<gt>
44  
45 Please also see the SUPPORT file in the distribution.
46  
47 =head1 SEE ALSO
48  
49 E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt>
50  
51 =head1 AUTHOR
52  
53 Patrick Mevzek, E<lt>netdri@dotandco.comE<gt>
54  
55 =head1 COPYRIGHT
56  
57 Copyright (c) 2006-2011,2013,2016 Patrick Mevzek <netdri@dotandco.com>.
58 All rights reserved.
59  
60 This program is free software; you can redistribute it and/or modify
61 it under the terms of the GNU General Public License as published by
62 the Free Software Foundation; either version 2 of the License, or
63 (at your option) any later version.
64  
65 See the LICENSE file that comes with this distribution for more details.
66  
67 =cut
68  
69 ####################################################################################################
70  
71 sub new
72 1 ▶{
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
73 1 my $class=shift;
74 1 my $self=$class->SUPER::new(@_);
75 1 $self->{info}->{host_as_attr}=2; ## this means we want IPs in all cases (even for nameservers in domain name)
76 1 $self->{info}->{contact_i18n}=2; ## INT only
77 1 return $self;
78 }
79  
80 0 ▶sub periods { return map { DateTime::Duration->new(years => $_) } (1); }
Subroutine periods: not called CC=1 SCAR=6.9
Pod documented
81 1 ▶sub name { return 'NicAT'; }
Subroutine name: called CC=1 SCAR=0.0
Pod documented
82 1 ▶sub tlds { return qw/at co.at or.at/; }
Subroutine tlds: called CC=1 SCAR=0.0
Pod documented
83 0 ▶sub object_types { return ('domain','contact'); }
Subroutine object_types: not called CC=1 SCAR=6.9
Pod documented
84 0 ▶sub profile_types { return qw/epp whois/; }
Subroutine profile_types: not called CC=1 SCAR=6.9
Pod undocumented
85  
86 sub transport_protocol_default
87 1 ▶{
Subroutine transport_protocol_default: called CC=3 SCAR=16.5
Pod undocumented
88 1 my ($self,$type)=@_;
89  
90 1 ▶ return ('Net::DRI::Transport::Socket',{},'Net::DRI::Protocol::EPP::Extensions::AT',{}) if $type eq 'epp';
Branch: 1 branch
BranchTrueFalseTotal
if $type eq "epp" 1 0 1
91 0 ▶ return ('Net::DRI::Transport::Socket',{remote_host=>'whois.nic.at'},'Net::DRI::Protocol::Whois',{}) if $type eq 'whois';
Branch: 1 branch
BranchTrueFalseTotal
if $type eq "whois" 0 0 0
92 0 return;
93 }
94  
95 sub set_factories
96 0 ▶{
Subroutine set_factories: not called CC=1 SCAR=6.9
Pod undocumented
97 0 my ($self,$po)=@_;
98 0 ▶ $po->factories('contact',sub { return Net::DRI::Data::Contact::AT->new(@_); });
Subroutine __ANON__: not called CC=1 SCAR=6.9
99 0 return;
100 }
101  
102 ####################################################################################################
103  
104 sub verify_name_domain
105 0 ▶{
Subroutine verify_name_domain: not called CC=1 SCAR=6.9
Pod undocumented
106 0 my ($self,$ndr,$domain,$op)=@_;
107 0 return $self->_verify_name_rules($domain,$op,{check_name_no_dots => 1, ## is this correct?
108 my_tld_not_strict => 1, ## is this correct?
109 });
110 }
111  
112 sub domain_withdraw
113 0 ▶{
Subroutine domain_withdraw: not called CC=1 SCAR=6.9
Pod undocumented
114 0 my ($self,$ndr,$domain,$rd)=@_;
115 0 $self->enforce_domain_name_constraints($ndr,$domain,'withdraw');
116 0 $rd=Net::DRI::Util::create_params('domain_withdraw',$rd);
117 0 $rd->{transactionname}='withdraw';
118  
119 0 my $rc=$ndr->process('domain','nocommand',[$domain,$rd]);
120 0 return $rc;
121 }
122  
123 sub domain_transfer_execute
124 0 ▶{
Subroutine domain_transfer_execute: not called CC=1 SCAR=6.9
Pod undocumented
125 0 my ($self,$ndr,$domain,$rd)=@_;
126 0 $self->enforce_domain_name_constraints($ndr,$domain,'transfer_execute');
127 0 $rd=Net::DRI::Util::create_params('domain_transfer_execute',$rd);
128 0 $rd->{transactionname}='transfer_execute';
129  
130 0 my $rc=$ndr->process('domain','nocommand',[$domain,$rd]);
131 0 return $rc;
132 }
133  
134 sub message_retrieve
135 0 ▶{
Subroutine message_retrieve: not called CC=1 SCAR=6.9
Pod undocumented
136 0 my ($self,$ndr,$id)=@_;
137 0 my $rc=$ndr->process('message','atretrieve',[$id]);
138 0 return $rc;
139 }
140  
141 sub message_delete
142 0 ▶{
Subroutine message_delete: not called CC=1 SCAR=6.9
Pod undocumented
143 0 my ($self,$ndr,$id)=@_;
144 0 my $rc=$ndr->process('message','atdelete',[$id]);
145 0 return $rc;
146 }
147  
148 sub message_count
149 0 ▶{
Subroutine message_count: not called CC=4 SCAR=30.0
Pod undocumented
150 0 my ($self,$ndr)=@_;
151 0 my $rc=$ndr->process('message','atretrieve');
152 0 ▶ return unless $rc->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $rc->is_success 0 0 0
153 0 my $count=$ndr->get_info('count','message','info');
154 0 ▶ return (defined($count) && $count)? $count : 0;
Branch: 1 branch
BranchTrueFalseTotal
defined $count && $count ? : 0 0 0
Condition0%0/3
defined $count and $count
!ll&&!rl&&r
000
MC/DC0%0/2
defined $count and $count
defined $count $count
Truth table0%0/3
A and B
A= defined $countB= $count
ABresult
0X0
100
111
155 }
156  
157 ####################################################################################################
158 2 1;
« DRI/DRD/VeriSign/NAME.pm ↑ Summary DRI/Protocol/Whois/Domain/COM.pm »