Identifiable/HasIdent.pm

filter: Statementstmt 100% 15 / 15 Branchbran 100% 2 / 2 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 100% 27 / 27 CC 3 SCAR 6.2
CC
3
Cov
100%
__ANON__
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.9
« Identifiable.pm ↑ Summary
1 package Role::Identifiable::HasIdent 0.009;
2 1 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 # ABSTRACT: a thing with an ident attribute
4  
5 #pod =head1 DESCRIPTION
6 #pod
7 #pod This is an incredibly simple role. It adds a required C<ident> attribute that
8 #pod stores a simple string, meant to identify exceptions.
9 #pod
10 #pod The string has to contain at least one character, and it can't start or end
11 #pod with whitespace.
12 #pod
13 #pod =cut
14  
15 1 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 has ident => (
18 is => 'ro',
19 5 ▶ isa => subtype('Str', where { length && /\A\S/ && /\S\z/ }),
Subroutine __ANON__: called CC=3 SCAR=11.0
Branch: 1 branch
BranchTrueFalseTotal
length $_ and /\A\S/ and /\S\z/ 2 3 5
Condition100%3/3
length $_ and /\A\S/
!ll&&!rl&&r
122
MC/DC100%2/2
length $_ and /\A\S/
length $_ /\A\S/
Truth table100%3/3
A and B
A= length $_B= /\A\S/
ABresult
0X0
100
111
20 required => 1,
21 );
22  
23 1 ▶no Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 1 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 1 1;
26  
27 __END__
« Identifiable.pm ↑ Summary