blib/lib/Storable/Improved.pm

filter: Statementstmt 100% 91 / 91 Branchbran 100% 4 / 4 Conditioncond 77.7% 14 / 18 MC/DCmcdc 62.5% 5 / 8 Subroutinesub 100% 13 / 13 Podpod 100% 2 / 2 totaltotal 94.8% 129 / 136 CC 9 SCAR 10.8
CC
9
Cov
96%
freeze
5.2
thaw
5.0
BEGIN
1.0
CRAP 3.0
↑ Summary
1 ##----------------------------------------------------------------------------
2 ## Storable Improved with Bug Fixes - ~/lib/Storable/Improved.pm
3 ## Version v0.1.4
4 ## Copyright(c) 2022 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <jack@deguest.jp>
6 ## Created 2022/07/23
7 ## Modified 2026/05/16
8 ## All rights reserved
9 ##
10 ##
11 ## This program is free software; you can redistribute it and/or modify it
12 ## under the same terms as Perl itself.
13 ##----------------------------------------------------------------------------
14 package Storable::Improved;
15 BEGIN
16 41 ▶{
Subroutine BEGIN: called CC=1 SCAR=0.0
17 41 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 41 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 41 ▶ use warnings::register;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 41 ▶ use Storable 3.25 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
21 41 ▶ use parent -norequire, qw( Storable );
Subroutine BEGIN: called CC=1 SCAR=0.0
22 41 ▶ use vars qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
23 $VERSION @EXPORT_OK @EXPORT @CARP_NOT
24 $accept_future_minor $canonical $flags $downgrade_restricted $forgive_me
25 41 $recursion_limit $recursion_limit_hash );
26 41 ▶ use Scalar::Util ();
Subroutine BEGIN: called CC=1 SCAR=0.0
27 41 @EXPORT = @Storable::EXPORT;
28 41 @EXPORT_OK = @Storable::EXPORT_OK;
29 41 *accept_future_minor = \$Storable::accept_future_minor;
30 41 *canonical = \$Storable::canonical;
31 41 *downgrade_restricted = \$Storable::downgrade_restricted;
32 41 *drop_utf8 = \$Storable::drop_utf8;
33 41 *flags = \$Storable::flags;
34 41 *forgive_me = \$Storable::forgive_me;
35 41 *recursion_limit = \$Storable::recursion_limit;
36 41 *recursion_limit_hash = \$Storable::recursion_limit_hash;
37 41 *Deparse = \$Storable::Deparse;
38 41 *Eval = \$Storable::Eval;
39 41 *DEBUGME = \$Storable::DEBUGME;
40 41 $VERSION = 'v0.1.4';
41 };
42  
43 41 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
44 41 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
45  
46 {
47 41 ▶ no warnings 'once';
Subroutine BEGIN: called CC=1 SCAR=0.0
48 41 *CLONE = \&Storable::CLONE;
49 41 *BLESS_OK = \&Storable::BLESS_OK;
50 41 *TIE_OK = \&Storable::TIE_OK;
51 41 *FLAGS_COMPAT = \&Storable::FLAGS_COMPAT;
52 41 *BIN_MAJOR = \&Storable::BIN_MAJOR;
53 41 *BIN_VERSION_NV = \&Storable::BIN_VERSION_NV;
54 41 *BIN_WRITE_MINOR = \&Storable::BIN_WRITE_MINOR;
55 41 *BIN_WRITE_VERSION_NV = \&Storable::BIN_WRITE_VERSION_NV;
56 41 *dclone = \&Storable::dclone;
57 41 *fd_retrieve = \&Storable::fd_retrieve;
58 41 *file_magic = \&Storable::file_magic;
59 41 *is_retrieving = \&Storable::is_retrieving;
60 41 *is_storing = \&Storable::is_storing;
61 41 *last_op_in_netorder = \&Storable::last_op_in_netorder;
62 41 *lock_nstore = \&Storable::lock_nstore;
63 41 *lock_retrieve = \&Storable::lock_retrieve;
64 41 *lock_store = \&Storable::lock_store;
65 41 *mretrieve = \&Storable::mretrieve;
66 41 *nfreeze = \&Storable::nfreeze;
67 41 *nstore = \&Storable::nstore;
68 41 *nstore_fd = \&Storable::nstore_fd;
69 41 *pretrieve = \&Storable::pretrieve;
70 41 *read_magic = \&Storable::read_magic;
71 41 *retrieve = \&Storable::retrieve;
72 41 *retrieve_fd = \&Storable::retrieve_fd;
73 41 *show_file_magic = \&Storable::show_file_magic;
74 41 *stack_depth = \&Storable::stack_depth;
75 41 *stack_depth_hash = \&Storable::stack_depth_hash;
76 41 *store = \&Storable::store;
77 41 *store_fd = \&Storable::store_fd;
78 41 *_freeze = \&Storable::_freeze;
79 41 *_make_re = \&Storable::_make_re;
80 41 *_regexp_pattern = \&Storable::_regexp_pattern;
81 41 *_retrieve = \&Storable::_retrieve;
82 41 *_store = \&Storable::_store;
83 41 *_store_fd = \&Storable::_store_fd;
84 }
85  
86 sub freeze
87 192 ▶{
Subroutine freeze: called CC=5 SCAR=16.5
Pod documented
88 192 my $obj = shift( @_ );
89 192 ▶ if( defined( $obj ) &&
Branch: 1 branch
BranchTrueFalseTotal
if (defined $obj and ref $obj and builtin::blessed($obj) and $obj->can("STORABLE_freeze_pre_processing")) 1 191 192
Condition66%6/9
defined $obj and ref $obj and builtin::blessed($obj) and $obj->can("STORABLE_freeze_pre_processing")
!ll&&!rl&&r
144471
defined $obj and ref $obj and builtin::blessed($obj)
!ll&&!rl&&r
014448
defined $obj and ref $obj
!ll&&!rl&&r
00192
MC/DC50%2/4
defined $obj and ref $obj and builtin::blessed($obj) and $obj->can("STORABLE_freeze_pre_processing")
defined $obj ref $obj builtin::blessed($obj) $obj->can("STORABLE_freeze_pre_processing")
Truth table60%3/5
A and B and C and D
A= defined $objB= ref $objC= builtin::blessed($obj)D= $obj->can("STORABLE_freeze_pre_processing")
ABCDresult
0XXX0
10XX0
110X0
11100
11111
90 ref( $obj ) &&
91 Scalar::Util::blessed( $obj ) &&
92 $obj->can( 'STORABLE_freeze_pre_processing' ) )
93 {
94 1 $obj = $obj->STORABLE_freeze_pre_processing;
95 }
96 192 return( Storable::freeze( $obj ) );
97 }
98  
99 sub thaw
100 333 ▶{
Subroutine thaw: called CC=5 SCAR=16.1
Pod documented
101 333 my( $frozen, $flags ) = @_;
102 333 my $obj = Storable::thaw( @_ );
103 280 ▶ if( defined( $obj ) &&
Branch: 1 branch
BranchTrueFalseTotal
if (defined $obj and ref $obj and builtin::blessed($obj) and $obj->can("STORABLE_thaw_post_processing")) 2 278 280
Condition88%8/9
defined $obj and ref $obj and builtin::blessed($obj) and $obj->can("STORABLE_thaw_post_processing")
!ll&&!rl&&r
234442
defined $obj and ref $obj and builtin::blessed($obj)
!ll&&!rl&&r
4419046
defined $obj and ref $obj
!ll&&!rl&&r
440236
MC/DC75%3/4
defined $obj and ref $obj and builtin::blessed($obj) and $obj->can("STORABLE_thaw_post_processing")
defined $obj ref $obj builtin::blessed($obj) $obj->can("STORABLE_thaw_post_processing")
Truth table80%4/5
A and B and C and D
A= defined $objB= ref $objC= builtin::blessed($obj)D= $obj->can("STORABLE_thaw_post_processing")
ABCDresult
0XXX0
10XX0
110X0
11100
11111
104 ref( $obj ) &&
105 Scalar::Util::blessed( $obj ) &&
106 $obj->can( 'STORABLE_thaw_post_processing' ) )
107 {
108 2 return( $obj->STORABLE_thaw_post_processing );
109 }
110 278 return( $obj );
111 }
112  
113 41 1;
114 # NOTE: POD
115 __END__
↑ Summary