ACME2/AccessorBase.pm

filter: Statementstmt 94.7% 18 / 19 Branchbran 66.6% 4 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 86.6% 26 / 30 SCAR 16.2
CC
5
Cov
88%
AUTOLOAD
4.2
new
2.0
BEGIN
1.0
CRAP 5.0
« ACME2/HTTP_Tiny.pm ↑ Summary ACME2/LetsEncrypt.pm »
1 package Net::ACME2::AccessorBase;
2  
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 our $AUTOLOAD;
7  
8 sub new {
9 2 ▶ my ($class, %opts) = @_;
Subroutine new: called CC=2 SCAR=6.9
Pod undocumented
10  
11 2 $opts{"_$_"} = delete $opts{$_} for keys %opts;
12  
13 2 return bless \%opts, $class;
14 }
15  
16 sub AUTOLOAD {
17 8 ▶ my ($self) = @_;
Subroutine AUTOLOAD: called CC=4 SCAR=14.2
18  
19 8 ▶ $AUTOLOAD =~ m<(.+)::(.+)> or die "Weird func name: “$AUTOLOAD”!";
Branch: 1 branch
BranchTrueFalseTotal
$Net::ACME2::AccessorBase::AUTOLOAD =~ /(.+)::(.+)/ or die "Weird func name: \342\200\234$Net::ACME2::AccessorBase::AUTOLOAD\342\200\235!" 0 8 8
20 8 my ($class, $method) = ($1, $2);
21  
22 8 ▶ if ( grep { $method eq $_ } $self->_ACCESSORS() ) {
Branch: 1 branch
BranchTrueFalseTotal
if (grep {$method eq $_;} $self->_ACCESSORS) 6 2 8
23 6 return $self->{"_$method"};
24 }
25  
26 2 ▶ return if $method eq 'DESTROY';
Branch: 1 branch
BranchTrueFalseTotal
if $method eq "DESTROY" 2 0 2
27  
28 0 die "“$class” doesn’t define a method “$method”!";
29 }
30  
31 4 1;
« ACME2/HTTP_Tiny.pm ↑ Summary ACME2/LetsEncrypt.pm »