Butcher/Inflator.pm

filter: Statementstmt 100% 22 / 22 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 96.7% 30 / 31 CC 4 SCAR 7.6
CC
4
Cov
100%
new
3.0
AUTOLOAD
2.0
BEGIN
1.0
CRAP 2.1
« Butcher.pm ↑ Summary
1 package Package::Butcher::Inflator;
2  
3 # Borrows heavily from Hash::Inflator
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 our $VERSION = '0.02';
8  
9 4 ▶sub new {
Subroutine new: called CC=3 SCAR=11.0
Pod undocumented
10 4 my $class = shift;
11  
12 #return $_[0] if @_ == 1 && !ref $_[0];
13 4 my %hash = %{ $_[0] };
14 4 for my $key ( keys %hash ) {
15 4 ▶ if ( ref $hash{$key} eq 'HASH' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $hash{$key} eq "HASH") 3 1 4
16 3 $hash{$key} = $class->new( $hash{$key} );
17 }
18 }
19 4 bless \%hash, $class;
20 }
21  
22 8 ▶sub AUTOLOAD {
Subroutine AUTOLOAD: called CC=2 SCAR=6.9
23 8 my $self = shift;
24 8 our $AUTOLOAD;
25 8 $AUTOLOAD =~ s/.+:://;
26 8 my $result = $self->{$AUTOLOAD};
27 8 ▶ if ( 'CODE' eq ref $result ) {
Branch: 1 branch
BranchTrueFalseTotal
if ('CODE' eq ref $result) { } 1 7 8
28 1 goto $result;
29 }
30 else {
31 7 return $result;
32 }
33 }
34  
35 2 1;
36  
37 __END__
« Butcher.pm ↑ Summary