ACME/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 CC 5 SCAR 10.4
CC
5
Cov
88%
AUTOLOAD
4.2
new
2.0
BEGIN
1.0
CRAP 2.8
« ACME/Certificate.pm ↑ Summary ACME/Authorization.pm »
1 package Net::ACME::AccessorBase;
2  
3 10 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 10 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 10 our $AUTOLOAD;
7  
8 #sub _ACCESSORS { ... }
9  
10 12 ▶sub new {
Subroutine new: called CC=2 SCAR=6.9
Pod undocumented
11 12 my ($class, %opts) = @_;
12  
13 12 $opts{"_$_"} = delete $opts{$_} for keys %opts;
14  
15 12 return bless \%opts, $class;
16 }
17  
18 65 ▶sub AUTOLOAD {
Subroutine AUTOLOAD: called CC=4 SCAR=14.2
19 65 my ($self) = @_;
20  
21 65 ▶ $AUTOLOAD =~ m<(.+)::(.+)> or die "Weird func name: “$AUTOLOAD”!";
Branch: 1 branch
BranchTrueFalseTotal
$Net::ACME::AccessorBase::AUTOLOAD =~ /(.+)::(.+)/ or die "Weird func name: \342\200\234$Net::ACME::AccessorBase::AUTOLOAD\342\200\235!" 65 0 65
22 65 my ($class, $method) = ($1, $2);
23  
24 65 ▶ if ( grep { $method eq $_ } $self->_ACCESSORS() ) {
Branch: 1 branch
BranchTrueFalseTotal
if (grep {$method eq $_;} $self->_ACCESSORS) 53 12 65
25 53 return $self->{"_$method"};
26 }
27  
28 12 ▶ return if $method eq 'DESTROY';
Branch: 1 branch
BranchTrueFalseTotal
if $method eq "DESTROY" 12 0 12
29  
30 0 die "“$class” doesn’t define a method “$method”!";
31 }
32  
33 10 1;
« ACME/Certificate.pm ↑ Summary ACME/Authorization.pm »