blib/lib/Class/HasA.pm

filter: Statementstmt 100% 25 / 25 Branchbran 83.3% 5 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 97.3% 37 / 38 CC 5 SCAR 10.4
CC
5
Cov
97%
import
5.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.8
↑ Summary
1 package Class::HasA;
2  
3 1 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 our $VERSION = '1.00';
9  
10 1 ▶sub import {
Subroutine import: called CC=5 SCAR=16.1
11 1 my ($self, @args) = @_;
12 1 ▶ croak "Wrong number of arguments to import" if @args & 1;
Branch: 1 branch
BranchTrueFalseTotal
if @args & 1 0 1 1
13  
14 1 ▶ while (my ($method, $how) = splice(@args, 0,2)) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = splice(@args, 0, 2)) 2 1 3
15 2 my @methods = $method;
16 2 ▶ @methods = @$method if ref $method eq "ARRAY";
Branch: 1 branch
BranchTrueFalseTotal
if ref $method eq "ARRAY" 1 1 2
17 2 for $method (@methods) {
18 1 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
19 3 ▶ *{caller()."::$method"} = sub { (shift->$how)->$method(@_) };
Subroutine __ANON__: called CC=1 SCAR=0.0
20 }
21 }
22 }
23  
24 # Preloaded methods go here.
25  
26 1 1;
27 __END__
↑ Summary