blib/lib/Cikl/DataTypes/Fqdn.pm

filter: Statementstmt 100% 25 / 25 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod n/a totaltotal 100% 36 / 36 CC 2 SCAR 1.8
CC
2
Cov
100%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« blib/lib/Cikl/DataTypes/Email.pm ↑ Summary testlib/Cikl/DataTypes/TestClass.pm »
1 package Cikl::DataTypes::Fqdn;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use Cikl::DataTypes::LowerCaseStr;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Mouse::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use Regexp::Common qw/net/;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 ▶use constant FQDN_RE => qr/^$RE{net}{domain}{-rfc1101}{-nospace}$/ ;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 subtype 'Cikl::DataTypes::Fqdn',
12 as 'Cikl::DataTypes::LowerCaseStr',
13 8 ▶ where {
Subroutine __ANON__: called CC=2 SCAR=6.9
14 8 ▶ $_ !~ /\s/ # No whitespace
Branch: 1 branch
BranchTrueFalseTotal
not $_ =~ /\s/ and $_ =~ /^(?:(?!(?:(?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})[.](?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})[.](?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})[.](?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2}))(?:[.]|$))[A-Za-z0-9](?:(?:[-A-Za-z0-9]){0,61}[A-Za-z0-9])?(?:\.(?!(?:(?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})[.](?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})[.](?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})[.](?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2}))(?:[.]|$))[A-Za-z0-9](?:(?:[-A-Za-z0-9]){0,61}[A-Za-z0-9])?)*)$/ 7 1 8
15 && $_ =~ FQDN_RE # proper fqdn
16 },
17 3 ▶ message { "Invalid fqdn '$_'"} ;
Subroutine __ANON__: called CC=1 SCAR=0.0
18  
19 2 1;
20  
« blib/lib/Cikl/DataTypes/Email.pm ↑ Summary testlib/Cikl/DataTypes/TestClass.pm »