DRI/Data/Contact/SIDN.pm

filter: Statementstmt 41.1% 14 / 34 Branchbran 0.0% 0 / 20 Conditioncond 0.0% 0 / 23 MC/DCmcdc 0.0% 0 / 13 Subroutinesub 66.6% 4 / 6 Podpod 0.0% 0 / 2 totaltotal 18.3% 18 / 98 CC 19 SCAR 48.9
CC
19
Cov
18%
validate
210.0
init
42.0
BEGIN
1.0
CRAP 133.2
« DRI/Protocol/EPP/Extensions/Nominet/Domain.pm ↑ Summary DRI/Protocol/Whois/Domain/AT.pm »
1 ## Domain Registry Interface, Handling of contact data for SIDN
2 ##
3 ## Copyright (c) 2009,2010,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::Data::Contact::SIDN;
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 base qw/Net::DRI::Data::Contact/;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 1 ▶use Net::DRI::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
23  
24 1 __PACKAGE__->register_attributes(qw(legal_form legal_id limited));
25  
26 ####################################################################################################
27  
28 sub validate
29 0 ▶{
Subroutine validate: not called CC=14 SCAR=53.5
Pod undocumented
30 0 my ($self,$change)=@_;
31 0 ▶ $change||=0;
Condition0%0/2
$change ||= 0
l!l
00
MC/DC0%0/1
$change ||= 0
$change
Truth table0%0/2
A
A= $change
Aresult
11
00
32  
33 0 $self->SUPER::validate(1); ## will trigger an Exception if problem
34  
35 0 ▶ if (!$change)
Branch: 1 branch
BranchTrueFalseTotal
unless ($change) 0 0 0
36 {
37 0 ▶ my @missing=grep { my $r=scalar $self->$_(); (defined $r && length $r)? 0 : 1 } qw/legal_form/;
Branch: 1 branch
BranchTrueFalseTotal
defined $r && length $r ? : 0 0 0
Condition0%0/3
defined $r and length $r
!ll&&!rl&&r
000
MC/DC0%0/2
defined $r and length $r
defined $r length $r
Truth table0%0/3
A and B
A= defined $rB= length $r
ABresult
0X0
100
111
38 0 ▶ Net::DRI::Exception::usererr_insufficient_parameters('Mandatory contact information missing: '.join('/',@missing)) if @missing;
Branch: 1 branch
BranchTrueFalseTotal
if @missing 0 0 0
39 }
40  
41 0 my @errs;
42 0 ▶ push @errs,'legal_form' if (defined $self->legal_form() && $self->legal_form()!~m!^(?:ANDERS|BGG|BRO|BV|BVI/O|COOP|CV|EENMANSZAAK|EESV|KERK|MAATSCHAP|NV|OWM|PERSOON|REDR|STICHTING|VERENIGING|VOF)$!o);
Branch: 1 branch
BranchTrueFalseTotal
if defined $self->legal_form and not $self->legal_form =~ m[^(?:ANDERS|BGG|BRO|BV|BVI/O|COOP|CV|EENMANSZAAK|EESV|KERK|MAATSCHAP|NV|OWM|PERSOON|REDR|STICHTING|VERENIGING|VOF)$]o 0 0 0
Condition0%0/3
defined $self->legal_form and not $self->legal_form =~ m[^(?:ANDERS|BGG|BRO|BV|BVI/O|COOP|CV|EENMANSZAAK|EESV|KERK|MAATSCHAP|NV|OWM|PERSOON|REDR|STICHTING|VERENIGING|VOF)$]o
!ll&&!rl&&r
000
MC/DC0%0/2
defined $self->legal_form and not $self->legal_form =~ m[^(?:ANDERS|BGG|BRO|BV|BVI/O|COOP|CV|EENMANSZAAK|EESV|KERK|MAATSCHAP|NV|OWM|PERSOON|REDR|STICHTING|VERENIGING|VOF)$]o
defined $self->legal_form not $self->legal_form =~ m[^(?:ANDERS|BGG|BRO|BV|BVI/O|COOP|CV|EENMANSZAAK|EESV|KERK|MAATSCHAP|NV|OWM|PERSOON|REDR|STICHTING|VERENIGING|VOF)$]o
Truth table0%0/3
A and not(B)
A= defined $self->legal_formB= not $self->legal_form =~ m[^(?:ANDERS|BGG|BRO|BV|BVI/O|COOP|CV|EENMANSZAAK|EESV|KERK|MAATSCHAP|NV|OWM|PERSOON|REDR|STICHTING|VERENIGING|VOF)$]o
ABresult
0X0
100
111
43  
44 ## Changes from core EPP
45 0 ▶ push @errs,'pc' if (defined $self->cc() && $self->cc() eq 'NL' && ! $self->pc());
Branch: 1 branch
BranchTrueFalseTotal
if defined $self->cc and $self->cc eq "NL" and not $self->pc 0 0 0
Condition0%0/6
defined $self->cc and $self->cc eq "NL" and not $self->pc
!ll&&!rl&&r
000
defined $self->cc and $self->cc eq "NL"
!ll&&!rl&&r
000
MC/DC0%0/3
defined $self->cc and $self->cc eq "NL" and not $self->pc
defined $self->cc $self->cc eq "NL" not $self->pc
Truth table0%0/4
A and B and not(C)
A= defined $self->ccB= $self->cc eq "NL"C= not $self->pc
ABCresult
0XX0
10X0
1100
1111
46 0 ▶ push @errs,'voice' if (!$change && ! $self->voice());
Branch: 1 branch
BranchTrueFalseTotal
unless $change or $self->voice 0 0 0
Condition0%0/3
$change or $self->voice
l!l&&r!l&&!r
000
MC/DC0%0/2
$change or $self->voice
$change $self->voice
Truth table0%0/3
A or B
A= $changeB= $self->voice
ABresult
1X1
011
000
47  
48 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('Invalid contact information: '.join('/',@errs)) if @errs;
Branch: 1 branch
BranchTrueFalseTotal
if @errs 0 0 0
49 0 return 1; ## everything ok.
50 }
51  
52 sub init
53 0 ▶{
Subroutine init: not called CC=6 SCAR=37.4
Pod undocumented
54 0 my ($self,$what,$ndr)=@_;
55 0 ▶ if ($what eq 'create')
Branch: 1 branch
BranchTrueFalseTotal
if ($what eq "create") 0 0 0
56 {
57 0 my $a=$self->auth();
58 0 ▶ $self->auth({pw=>''}) unless ($a && (ref($a) eq 'HASH') && exists($a->{pw})); ## authInfo is not used
Branch: 1 branch
BranchTrueFalseTotal
unless $a and ref $a eq "HASH" and exists $a->{"pw"} 0 0 0
Condition0%0/6
$a and ref $a eq "HASH" and exists $a->{"pw"}
!ll&&!rl&&r
000
$a and ref $a eq "HASH"
!ll&&!rl&&r
000
MC/DC0%0/3
$a and ref $a eq "HASH" and exists $a->{"pw"}
$a ref $a eq "HASH" exists $a->{"pw"}
Truth table0%0/4
A and B and C
A= $aB= ref $a eq "HASH"C= exists $a->{"pw"}
ABCresult
0XX0
10X0
1100
1111
59 0 ▶ $self->srid('ABCD') unless defined $self->srid(); ## we can not choose the ID
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->srid 0 0 0
60 }
61 0 return;
62 }
63  
64 ####################################################################################################
65 1 1;
66  
67 __END__
« DRI/Protocol/EPP/Extensions/Nominet/Domain.pm ↑ Summary DRI/Protocol/Whois/Domain/AT.pm »