blib/lib/Data/Message/Simple.pm

filter: Statementstmt 100% 32 / 32 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 1 totaltotal 97.6% 41 / 42 CC 2 SCAR 2.2
CC
2
Cov
100%
BUILD
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
↑ Summary
1 package Data::Message::Simple;
2  
3 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 6 ▶use Mo qw(build is);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 6 ▶use Mo::utils 0.15 qw(check_length check_required check_strings);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 6 ▶use Mo::utils::Language 0.05 qw(check_language_639_1);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 6 ▶use Readonly;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 6 Readonly::Array our @TYPES => qw(info error);
12  
13 6 our $VERSION = 0.05;
14  
15 6 has lang => (
16 is => 'ro',
17 );
18  
19 6 has text => (
20 is => 'ro',
21 );
22  
23 6 has type => (
24 is => 'ro',
25 );
26  
27 12 ▶sub BUILD {
Subroutine BUILD: called CC=2 SCAR=6.9
Pod undocumented
28 12 my $self = shift;
29  
30 # Check lang.
31 12 check_language_639_1($self, 'lang');
32  
33 # Check text.
34 11 check_required($self, 'text');
35 10 check_length($self, 'text', 4096);
36  
37 # Check message type.
38 9 ▶ if (! defined $self->{'type'}) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"type"}) 5 4 9
39 5 $self->{'type'} = 'info';
40 }
41 9 check_strings($self, 'type', \@TYPES);
42  
43 8 return;
44 }
45  
46 6 1;
47  
48 __END__
↑ Summary