blib/lib/MooseX/Types/CNPJ.pm

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