DRI/DRD/CIRA.pm

filter: Statementstmt 70.2% 26 / 37 Branchbran 25.0% 1 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 64.2% 9 / 14 Podpod 44.4% 4 / 9 totaltotal 57.9% 40 / 69 CC 4 SCAR 12.0
CC
4
Cov
61%
agreement_info
12.0
transport_protocol_default
2.3
periods
2.0
CRAP 3.3
« DRI/DRD/PIR.pm ↑ Summary DRI/Protocol/EPP/Extensions/Nominet/Message.pm »
1 ## Domain Registry Interface, CIRA (.CA) Registry Driver
2 ##
3 ## Copyright (c) 2010-2011,2018-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::DRD::CIRA;
16  
17 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 2 ▶use base qw/Net::DRI::DRD/;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 2 ▶use DateTime::Duration;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 2 ▶use Net::DRI::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
23  
24 2 __PACKAGE__->make_exception_for_unavailable_operations(qw/domain_transfer_stop domain_transfer_query domain_transfer_accept domain_transfer_refuse/);
25  
26 ####################################################################################################
27  
28 sub new
29 1 ▶{
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
30 1 my $class=shift;
31 1 my $self=$class->SUPER::new(@_);
32 1 $self->{info}->{host_as_attr}=0;
33 1 $self->{info}->{contact_i18n}=1; ## LOC only
34 1 return $self;
35 }
36  
37 0 ▶sub periods { return map { DateTime::Duration->new(years => $_) } (1..10); }
Subroutine periods: not called CC=1 SCAR=6.9
Pod documented
38 1 ▶sub name { return 'CIRA'; }
Subroutine name: called CC=1 SCAR=0.0
Pod documented
39 1 ▶sub tlds { return (qw/ca/); }
Subroutine tlds: called CC=1 SCAR=0.0
Pod documented
40 0 ▶sub object_types { return (qw/domain contact ns/); }
Subroutine object_types: not called CC=1 SCAR=6.9
Pod documented
41 0 ▶sub profile_types { return qw/epp/; }
Subroutine profile_types: not called CC=1 SCAR=6.9
Pod undocumented
42  
43 sub transport_protocol_default
44 1 ▶{
Subroutine transport_protocol_default: called CC=2 SCAR=8.1
Pod undocumented
45 1 my ($self,$type)=@_;
46  
47 1 ▶ return ('Net::DRI::Transport::Socket',{ssl_version => 'TLSv12'},'Net::DRI::Protocol::EPP::Extensions::CIRA',{}) if $type eq 'epp';
Branch: 1 branch
BranchTrueFalseTotal
if $type eq "epp" 1 0 1
48 0 return;
49 }
50  
51 ####################################################################################################
52  
53 sub verify_name_domain
54 0 ▶{
Subroutine verify_name_domain: not called CC=1 SCAR=6.9
Pod undocumented
55 0 my ($self,$ndr,$domain,$op)=@_;
56 0 return $self->_verify_name_rules($domain,$op,{check_name=>1,check_name_dots=>[1,2,3],my_tld_not_strict=>1});
57 }
58  
59 sub agreement_info
60 0 ▶{
Subroutine agreement_info: not called CC=3 SCAR=24.8
Pod undocumented
61 0 my ($self,$ndr,$language)=@_;
62 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('CIRA agreement language must be "en" or "fr"') if (defined $language && $language!~m/^(?:fr|en)$/);
Branch: 1 branch
BranchTrueFalseTotal
if defined $language and not $language =~ /^(?:fr|en)$/ 0 0 0
Condition0%0/3
defined $language and not $language =~ /^(?:fr|en)$/
!ll&&!rl&&r
000
MC/DC0%0/2
defined $language and not $language =~ /^(?:fr|en)$/
defined $language not $language =~ /^(?:fr|en)$/
Truth table0%0/3
A and not(B)
A= defined $languageB= not $language =~ /^(?:fr|en)$/
ABresult
0X0
100
111
63  
64 0 my $rc=$ndr->process('agreement', 'info', [ $language ]);
65 0 return $rc;
66 }
67  
68 ####################################################################################################
69 2 1;
70  
71 __END__
« DRI/DRD/PIR.pm ↑ Summary DRI/Protocol/EPP/Extensions/Nominet/Message.pm »