blib/lib/DR/Msgpuck/Bool.pm

filter: Statementstmt 76.4% 26 / 34 Branchbran 66.6% 4 / 6 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 73.3% 11 / 15 Podpod 0.0% 0 / 3 totaltotal 66.6% 42 / 63 SCAR 17.1
CC
5
Cov
72%
TO_JSON
6.0
new
3.1
__ANON__
2.0
CRAP 5.5
« blib/lib/DR/Msgpuck/Str.pm ↑ Summary blib/lib/DR/Msgpuck/Num.pm »
1 3 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5  
6 package DR::Msgpuck::Bool;
7  
8 use overload
9 0 ▶ bool => sub { ${ $_[0] } },
Subroutine __ANON__: not called CC=1 SCAR=6.9
10 0 ▶ int => sub { ${ $_[0] } },
Subroutine __ANON__: not called CC=1 SCAR=6.9
11 0 ▶ '!' => sub { $_[0]->new(!${ $_[0] }) },
Subroutine __ANON__: not called CC=1 SCAR=6.9
12 2 ▶ '""' => sub { ${ $_[0] } },
Subroutine __ANON__: called CC=1 SCAR=0.0
13 3 ▶;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 sub TO_JSON {
16 0 ▶ my ($self) = @_;
Subroutine TO_JSON: not called CC=2 SCAR=17.9
Pod undocumented
17 0 ▶ $$self ? 'true' : 'false';
Branch: 1 branch
BranchTrueFalseTotal
$$self ? : 0 0 0
18 }
19  
20 sub TO_MSGPACK {
21 14 ▶ my ($self) = @_;
Subroutine TO_MSGPACK: called CC=2 SCAR=6.9
Pod undocumented
22 14 ▶ pack 'C', $$self ? 0xC3 : 0xC2;
Branch: 1 branch
BranchTrueFalseTotal
$$self ? : 7 7 14
23 }
24  
25 sub new {
26 6 ▶ my ($class, $v) = @_;
Subroutine new: called CC=3 SCAR=11.4
Pod undocumented
27 6 ▶ $v = $v ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$v ? : 3 3 6
28 6 ▶ bless \$v => ref($class) || $class;
Condition33%1/3
ref $class || $class
l!l&&r!l&&!r
060
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table33%1/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
29 }
30  
31 package DR::Msgpuck::True;
32 3 ▶BEGIN { our @ISA = ('DR::Msgpuck::Bool'); }
Subroutine BEGIN: called CC=1 SCAR=0.0
33  
34 sub new {
35 3 ▶ my ($class) = @_;
Subroutine new: called CC=1 SCAR=0.0
36 3 $class->SUPER::new(1);
37 }
38  
39 package DR::Msgpuck::False;
40 3 ▶BEGIN { our @ISA = ('DR::Msgpuck::Bool'); }
Subroutine BEGIN: called CC=1 SCAR=0.0
41  
42 sub new {
43 3 ▶ my ($class) = @_;
Subroutine new: called CC=1 SCAR=0.0
44 3 $class->SUPER::new(0);
45 }
46  
47 3 1;
48  
49 __END__
« blib/lib/DR/Msgpuck/Str.pm ↑ Summary blib/lib/DR/Msgpuck/Num.pm »