DWH_File/Cache.pm

filter: Statementstmt 100% 24 / 24 Branchbran 100% 2 / 2 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 4 totaltotal 80.9% 34 / 42 CC 3 SCAR 3.8
CC
3
Cov
93%
new
2.1
retrieve
2.0
BEGIN
1.0
CRAP 1.5
« DWH_File/Registry/URI.pm ↑ Summary DWH_File/Subscript/Wired.pm »
1 package DWH_File::Cache;
2  
3 9 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 9 ▶use vars qw( @ISA $VERSION );
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 9 @ISA = qw( );
8 9 $VERSION = 0.1;
9  
10 13 ▶sub new {
Subroutine new: called CC=2 SCAR=7.2
Pod undocumented
11 13 my ( $this ) = @_;
12 13 ▶ my $class = ref $this || $this;
Condition33%1/3
ref $this || $this
l!l&&r!l&&!r
0130
MC/DC0%0/2
ref $this || $this
ref $this $this
Truth table33%1/3
A || B
A= ref $thisB= $this
ABresult
1X1
011
000
13 13 my $self = {};
14 13 bless $self, $class;
15 13 return $self;
16 }
17  
18 61 ▶sub encache {
Subroutine encache: called CC=1 SCAR=0.0
Pod undocumented
19 # weaken if available
20 61 $_[ 0 ]->{ $_[ 1 ]->cache_key } = $_[ 1 ];
21 61 $_[ 1 ]->cache_up;
22 }
23  
24 13 ▶sub decache {
Subroutine decache: called CC=1 SCAR=0.0
Pod undocumented
25 13 delete $_[ 0 ]->{ $_[ 1 ]->cache_key };
26 13 $_[ 1 ]->cache_down;
27 }
28  
29 306 ▶sub retrieve {
Subroutine retrieve: called CC=2 SCAR=6.9
Pod undocumented
30 306 ▶ if ( exists $_[ 0 ]->{ $_[ 1 ] } ) { return $_[ 0 ]->{ $_[ 1 ] } }
Branch: 1 branch
BranchTrueFalseTotal
if (exists $_[0]{$_[1]}) { } 273 33 306
31 33 else { return undef }
32 }
33  
34  
35 9 1;
36  
37 __END__
« DWH_File/Registry/URI.pm ↑ Summary DWH_File/Subscript/Wired.pm »