Secret/Serializable.pm

filter: Statementstmt 72.7% 16 / 22 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 6 / 10 Podpod 0.0% 0 / 7 totaltotal 58.5% 24 / 41 CC 2 SCAR 4.4
CC
2
Cov
75%
to_serializable
2.0
STORABLE_freeze
2.0
TO_CBOR
2.0
CRAP 1.5
↑ Summary Secret.pm »
1 package String::Secret::Serializable;
2 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 5 ▶use parent qw/String::Secret/;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 0 ▶sub to_serializable { shift }
Subroutine to_serializable: not called CC=1 SCAR=6.9
Pod undocumented
8  
9 # for Storable
10 2 ▶sub STORABLE_freeze {
Subroutine STORABLE_freeze: called CC=2 SCAR=6.9
Pod undocumented
11 2 my ($self, $cloning) = @_;
12 2 ▶ return $self->SUPER::STORABLE_freeze($cloning) if $cloning;
Branch: 1 branch
BranchTrueFalseTotal
if $cloning 1 1 2
13 1 return $self->unwrap;
14 }
15 2 ▶sub STORABLE_thaw {
Subroutine STORABLE_thaw: called CC=1 SCAR=0.0
Pod undocumented
16 2 my ($self, $cloning, $raw) = @_;
17 2 return $self->SUPER::STORABLE_thaw(1, $raw); # force cloging to set REAL secret
18 }
19  
20 # for JSON modules
21 1 ▶sub TO_JSON { shift->unwrap }
Subroutine TO_JSON: called CC=1 SCAR=0.0
Pod undocumented
22  
23 # for CBOR
24 0 ▶sub TO_CBOR { shift->unwrap }
Subroutine TO_CBOR: not called CC=1 SCAR=6.9
Pod undocumented
25  
26 # for JSON, CBOR, Sereal, ...
27 0 ▶sub FREEZE {
Subroutine FREEZE: not called CC=1 SCAR=6.9
Pod undocumented
28 0 my ($self, $serialiser) = @_;
29 0 return $self->unwrap;
30 }
31 0 ▶sub THAW {
Subroutine THAW: not called CC=1 SCAR=6.9
Pod undocumented
32 0 my ($class, $serialiser, $raw) = @_;
33 0 return $class->new($raw);
34 }
35  
36 5 1;
37 __END__
↑ Summary Secret.pm »