Aspect/Library/Listenable/Event.pm

filter: Statementstmt 84.0% 21 / 25 Branchbran 83.3% 5 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 3 totaltotal 77.5% 31 / 40 SCAR 14.0
CC
4
Cov
84%
AUTOLOAD
3.0
clone
2.0
as_string
2.0
CRAP 4.1
« Aspect/Pointcut/Throwing.pm ↑ Summary Aspect/Library/Singleton.pm »
1 package Aspect::Library::Listenable::Event;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 our $VERSION = '0.97_06';
7  
8 sub new {
9 13 ▶ my $class = shift;
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
10 13 bless { @_ }, $class;
11 }
12  
13 sub AUTOLOAD {
14 31 ▶ my ($self, $value) = @_;
Subroutine AUTOLOAD: called CC=3 SCAR=11.0
15 31 my $key = our $AUTOLOAD;
16 31 ▶ return if $key =~ /DESTROY$/;
Branch: 1 branch
BranchTrueFalseTotal
if $key =~ /DESTROY$/ 13 18 31
17 18 $key =~ s/^.*:://;
18 return @_ == 1
19 ? $self->{$key}
20 18 ▶ : ( $self->{$key} = $value );
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 ? : 18 0 18
21 }
22  
23 sub clone {
24 7 ▶ my $self = shift;
Subroutine clone: called CC=2 SCAR=6.9
Pod undocumented
25 7 my $class = ref $self;
26 7 my $clone = $class->new;
27 7 ▶ while ( my ($key, $value) = each %$self ) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %$self) 23 7 30
28 23 $clone->{$key} = $value;
29 }
30 7 return $clone;
31 }
32  
33 sub as_string {
34 0 ▶ my $self = shift;
Subroutine as_string: not called CC=1 SCAR=6.9
Pod undocumented
35 0 local $_;
36 0 return join ', ', map { "$_:$self->{$_}" } sort keys %$self;
37 }
38  
39 2 1;
« Aspect/Pointcut/Throwing.pm ↑ Summary Aspect/Library/Singleton.pm »