| 1 | 3 | ▶ | use 5.014002; | ||||||||||||||||||
|
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 | package DR::Msgpuck::Bool; | ||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 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
| |||||||||||||||||||||
| 17 | 0 | ▶ | $$self ? 'true' : 'false'; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 18 | } | ||||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | sub TO_MSGPACK { | ||||||||||||||||||||
| 21 | 14 | ▶ | my ($self) = @_; | ||||||||||||||||||
|
Subroutine
TO_MSGPACK: called CC=2 SCAR=6.9
| |||||||||||||||||||||
| 22 | 14 | ▶ | pack 'C', $$self ? 0xC3 : 0xC2; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 23 | } | ||||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | sub new { | ||||||||||||||||||||
| 26 | 6 | ▶ | my ($class, $v) = @_; | ||||||||||||||||||
|
Subroutine
new: called CC=3 SCAR=11.4
| |||||||||||||||||||||
| 27 | 6 | ▶ | $v = $v ? 1 : 0; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 28 | 6 | ▶ | bless \$v => ref($class) || $class; | ||||||||||||||||||
|
Condition33%1/3
ref $class || $class
MC/DC0%0/2
ref $class || $class
ref $class
$class
Truth table33%1/3
A || B
A= ref $classB= $class
| |||||||||||||||||||||
| 29 | } | ||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | package DR::Msgpuck::True; | ||||||||||||||||||||
| 32 | 3 | ▶ | use base '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 | ▶ | use base '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 | |||||||||||||||||||||
| 48 | package DR::Msgpuck; | ||||||||||||||||||||
| 49 | 3 | require Exporter; | |||||||||||||||||||
| 50 | 3 | ▶ | use AutoLoader qw(AUTOLOAD); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 51 | |||||||||||||||||||||
| 52 | 3 | our @ISA = qw(Exporter); | |||||||||||||||||||
| 53 | 3 | our @EXPORT_OK = qw(msgpack msgunpack msgunpack_utf8); | |||||||||||||||||||
| 54 | 3 | our @EXPORT = @EXPORT_OK; | |||||||||||||||||||
| 55 | 3 | our $VERSION = '0.01'; | |||||||||||||||||||
| 56 | |||||||||||||||||||||
| 57 | 3 | require XSLoader; | |||||||||||||||||||
| 58 | 3 | XSLoader::load('DR::Msgpuck', $VERSION); | |||||||||||||||||||
| 59 | |||||||||||||||||||||
| 60 | 3 | 1; | |||||||||||||||||||
| 61 | __END__ | ||||||||||||||||||||