KiokuDB/LiveObjects/Guard.pm

filter: Statementstmt 100% 23 / 23 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 3 totaltotal 91.6% 33 / 36 CC 2 SCAR 2.0
CC
2
Cov
100%
DESTROY
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« KiokuDB/Backend/Serialize/Storable.pm ↑ Summary KiokuDB/TypeMap/Entry/Ref.pm »
1 package KiokuDB::LiveObjects::Guard;
2  
3 22 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 22 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 22 ▶use Scalar::Util qw(weaken);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 22 ▶use namespace::clean -except => 'meta';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 sub new {
11 7010 ▶ my ( $class, $hash, $key ) = @_;
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
12 7010 my $self = bless [ $hash, $key ], $class;
13 7010 weaken $self->[0];
14 7010 return $self;
15 }
16  
17 sub key {
18 7806 ▶ $_[0][1];
Subroutine key: called CC=1 SCAR=0.0
Pod undocumented
19 }
20  
21 sub DESTROY {
22 7002 ▶ my $self = shift;
Subroutine DESTROY: called CC=2 SCAR=6.9
23 7002 my ( $hash, $key ) = splice @$self;
24 7002 ▶ delete $hash->{$key} if $hash;
Branch: 1 branch
BranchTrueFalseTotal
if $hash 6981 21 7002
25 }
26  
27 sub dismiss {
28 3 ▶ my $self = shift;
Subroutine dismiss: called CC=1 SCAR=0.0
Pod undocumented
29 3 @$self = ();
30 }
31  
32  
33 22 __PACKAGE__
34  
35 __END__
« KiokuDB/Backend/Serialize/Storable.pm ↑ Summary KiokuDB/TypeMap/Entry/Ref.pm »