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 CC 5 SCAR 7.6
CC
5
Cov
72%
TO_JSON
6.0
new
3.1
__ANON__
2.0
CRAP 2.1
« blib/lib/DR/Msgpuck/Num.pm ↑ Summary msgpuck.h »
1 4 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 4 ▶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 BEGIN: called CC=1 SCAR=1.5
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 4 ;
14  
15 0 ▶sub TO_JSON {
Subroutine TO_JSON: not called CC=2 SCAR=17.9
Pod undocumented
16 0 my ($self) = @_;
17 0 ▶ $$self ? 'true' : 'false';
Branch: 1 branch
BranchTrueFalseTotal
$$self ? : 0 0 0
18 }
19  
20 14 ▶sub TO_MSGPACK {
Subroutine TO_MSGPACK: called CC=2 SCAR=6.9
Pod undocumented
21 14 my ($self) = @_;
22 14 ▶ pack 'C', $$self ? 0xC3 : 0xC2;
Branch: 1 branch
BranchTrueFalseTotal
$$self ? : 7 7 14
23 }
24  
25 6 ▶sub new {
Subroutine new: called CC=3 SCAR=11.4
Pod undocumented
26 6 my ($class, $v) = @_;
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 4 ▶BEGIN { our @ISA = ('DR::Msgpuck::Bool'); }
Subroutine BEGIN: called CC=1 SCAR=0.0
33  
34 3 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
35 3 my ($class) = @_;
36 3 $class->SUPER::new(1);
37 }
38  
39 package DR::Msgpuck::False;
40 4 ▶BEGIN { our @ISA = ('DR::Msgpuck::Bool'); }
Subroutine BEGIN: called CC=1 SCAR=0.0
41  
42 3 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
43 3 my ($class) = @_;
44 3 $class->SUPER::new(0);
45 }
46  
47 4 1;
48  
49 __END__
« blib/lib/DR/Msgpuck/Num.pm ↑ Summary msgpuck.h »