blib/lib/overload/x.pm

filter: Statementstmt 100% 26 / 26 Branchbran 100% 6 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 100% 2 / 2 totaltotal 100% 42 / 42 CC 4 SCAR 7.4
CC
4
Cov
100%
x
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.1
↑ Summary
1 package overload::x;
2 2 ▶use 5.006; use strict; use warnings; our $VERSION = '0.101';
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use base 'Import::Export';
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use Function::Fallback::CoreOrPP qw(clone);
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 our %EX = (
7 n => [qw/all/],
8 x => [qw/all/]
9 );
10  
11 use overload
12 2 ▶ 'x' => \&x;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 sub n {
15 2 ▶ my $n = shift; # \shift is really broken AND has varying behaviour depending on which OS you're using apparently
Subroutine n: called CC=1 SCAR=0.0
Pod documented
16 2 return bless \$n, __PACKAGE__;
17 }
18  
19 sub x {
20 5 ▶ my ($times, $obj) = @_;
Subroutine x: called CC=4 SCAR=13.9
Pod documented
21 my @times = map {
22 5 ▶ ref $obj ? clone($obj) : $obj
Branch: 2 branches
BranchTrueFalseTotal
ref $obj ? : 6 15 21
ref $times ? : 2 3 5
23 } 1 .. (ref $times ? $$times : $times); # IN list context this counts which suckkks...
24 5 ▶ wantarray ? @times : \@times;
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 2 3 5
25 }
26  
27 2 1;
28  
29 __END__
↑ Summary