blib/lib/Mason/CodeCache.pm

filter: Statementstmt 100% 54 / 54 Branchbran 50.0% 4 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 14 / 14 Podpod n/a totaltotal 94.7% 72 / 76 CC 5 SCAR 4.9
CC
5
Cov
94%
__ANON__
3.1
remove
3.1
BEGIN
1.0
CRAP 1.6
« blib/lib/Mason/Plugin.pm ↑ Summary blib/lib/Mason/Types.pm »
1 package Mason::CodeCache;
2 22 $Mason::CodeCache::VERSION = '2.24';
3 22 ▶use Devel::GlobalDestruction;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 22 ▶use Mason::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 22 ▶use Mason::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 87 ▶has 'datastore' => ( is => 'ro', isa => 'HashRef', default => sub { {} } );
Subroutine __ANON__: called CC=1 SCAR=0.0
8  
9 22 ▶method get ($key) {
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine get: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
10 270 return $self->{datastore}->{$key};
11 22 }
12  
13 22 ▶method set ($key, $data) {
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
Subroutine set: called CC=1 SCAR=0.0
14 74 $self->{datastore}->{$key} = $data;
15 22 }
16  
17 22 ▶method remove ($key) {
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine remove: called CC=3 SCAR=11.3
18 201 ▶ if ( my $entry = $self->{datastore}->{$key} ) {
Branch: 2 branches
BranchTrueFalseTotal
if (my $entry = $self->{"datastore"}{$key}) 201 0 201
if (my $entry = $self->{"datastore"}{$key}) 26 0 26
19 201 ▶ if ( !in_global_destruction() ) {
Branch: 2 branches
BranchTrueFalseTotal
unless (&in_global_destruction()) 201 0 201
unless (&in_global_destruction()) 26 0 26
20 201 my $compc = $entry->{compc};
21 201 $compc->_unset_class_cmeta();
22 201 $compc->meta->make_mutable();
23 201 Mason::Util::delete_package($compc);
24 }
25 201 delete $self->{datastore}->{$key};
26 }
27 22 }
28  
29 22 ▶method get_keys () {
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine get_keys: called CC=1 SCAR=0.0
30 89 return keys( %{ $self->{datastore} } );
31 22 }
32  
33 22 __PACKAGE__->meta->make_immutable();
34  
35 22 1;
36  
37 __END__
« blib/lib/Mason/Plugin.pm ↑ Summary blib/lib/Mason/Types.pm »