blib/lib/MooseX/Types/CIDR.pm

filter: Statementstmt 83.3% 20 / 24 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 62.5% 5 / 8 Podpod n/a totaltotal 78.1% 25 / 32 CC 1 SCAR 2.4
CC
1
Cov
83%
_validate_cidr
2.0
__ANON__
2.0
__ANON__
1.1
CRAP 1.3
↑ Summary
1 package MooseX::Types::CIDR;
2 {
3 2 $MooseX::Types::CIDR::VERSION = '1.000000';
4 }
5 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 our $AUTHORITY = 'CPAN:TBR';
9  
10 2 ▶use MooseX::Types -declare => ['CIDR'];
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use MooseX::Types::Moose qw(Str);
Subroutine BEGIN: called CC=1 SCAR=0.0
12 2 ▶use Net::CIDR;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 0 ▶sub _validate_cidr {
Subroutine _validate_cidr: not called CC=1 SCAR=6.9
15 0 my ($str) = @_;
16 0 return Net::CIDR::cidrvalidate($str);
17 }
18  
19 subtype CIDR,
20 as Str,
21 0 ▶ where { _validate_cidr($_) },
Subroutine __ANON__: not called CC=1 SCAR=6.9
22 0 ▶ message { 'CIDR is invalid' };
Subroutine __ANON__: not called CC=1 SCAR=1.2
23  
24 2 1;
25  
26 __END__
↑ Summary