blib/lib/Acme/Acotie.pm

filter: Statementstmt 100% 32 / 32 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 100% 39 / 39 CC 2 SCAR 2.2
CC
2
Cov
100%
import
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
↑ Summary
1 package Acme::Acotie;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 our $VERSION = '0.02';
6  
7 1 ▶use Class::Inspector;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use List::Util 'shuffle';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶sub import {
Subroutine import: called CC=2 SCAR=6.9
11 1 my $class = shift;
12 1 my $pkg = caller;
13  
14 1 my @functions = @{ Class::Inspector->functions($pkg) };
15 1 my @function_refs = @{ Class::Inspector->function_refs($pkg) };
16 1 my $num = scalar(@functions) - 1;
17 1 my @idx = shuffle 0..$num;
18  
19 1 my $i = 0;
20 1 for my $func (@functions) {
21 1 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 ▶ no warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 21 *{"$pkg\::$func"} = $function_refs[$idx[$i++]];
24 }
25  
26 }
27  
28 1 1;
29 __END__
↑ Summary