Dukedom/Signal.pm

filter: Statementstmt 73.9% 17 / 23 Branchbran 100% 2 / 2 Conditioncond 40.0% 2 / 5 MC/DCmcdc 33.3% 1 / 3 Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 68.4% 26 / 38 CC 5 SCAR 17.7
CC
5
Cov
70%
as_string
12.0
__ANON__
3.0
BEGIN
1.0
CRAP 5.9
« Dukedom.pm ↑ Summary
1 package Games::Dukedom::Signal;
2  
3 4 our $VERSION = 'v0.1.2';
4  
5 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 with 'Throwable';
7  
8 use overload
9 4 ▶ q{""} => 'as_string',
Subroutine BEGIN: called CC=1 SCAR=0.0
10 4 fallback => 1;
11  
12 2 ▶around BUILDARGS => sub {
Subroutine __ANON__: called CC=3 SCAR=11.0
13 2 my $orig = shift;
14 2 my $class = shift;
15  
16 2 ▶ unshift( @_, 'msg' ) if @_ == 1 && !ref( $_[0] );
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 1 and not ref $_[0] 1 1 2
Condition66%2/3
@_ == 1 and not ref $_[0]
!ll&&!rl&&r
101
MC/DC50%1/2
@_ == 1 and not ref $_[0]
@_ == 1 not ref $_[0]
Truth table66%2/3
A and not(B)
A= @_ == 1B= not ref $_[0]
ABresult
0X0
100
111
17  
18 2 return $class->$orig( {@_} );
19 4 };
20  
21 4 has msg => (
22 is => 'ro',
23 default => undef,
24 );
25  
26 4 has action => (
27 is => 'ro',
28 default => undef,
29 );
30  
31 4 has default => (
32 is => 'ro',
33 default => undef,
34 );
35  
36 0 ▶sub as_string {
Subroutine as_string: not called CC=3 SCAR=24.8
Pod documented
37 0 my $self = shift;
38  
39 0 my $str = ref($self);
40 0 for ( keys(%{$self}) ) {
41 0 ▶ $str .= "\n $_: " . ($self->{$_} || '');
Condition0%0/2
$self->{$_} || ''
l!l
00
MC/DC0%0/1
$self->{$_} || ''
$self->{$_}
Truth table0%0/2
A
A= $self->{$_}
Aresult
11
00
42 }
43  
44 0 return $str;
45 }
46  
47 4 1;
48  
49 __END__
« Dukedom.pm ↑ Summary