alias.pm

filter: Statementstmt 100% 29 / 29 Branchbran 83.3% 5 / 6 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 8 / 8 Podpod n/a totaltotal 89.5% 43 / 48 CC 5 SCAR 6.1
CC
5
Cov
92%
import
3.0
Animals
2.0
Nature
2.0
CRAP 1.8
« loader.pm ↑ Summary loader/TOML.pm »
1 2 ▶use 5.008008;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package portable::alias;
6  
7 1 our $AUTHORITY = 'cpan:TOBYINK';
8 1 our $VERSION = '0.003';
9  
10 2 ▶use portable::loader ();
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use B ();
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 2 ▶sub import {
Subroutine import: called CC=3 SCAR=11.1
14 2 my $me = shift;
15 2 my $caller = caller;
16 2 my ($collection, $as) = @_;
17 2 ▶ $as ||= $collection;
Condition33%1/3
$as ||= $collection
l!l&&r!l&&!r
020
MC/DC0%0/2
$as ||= $collection
$as $collection
Truth table33%1/3
A ||= B
A= $asB= $collection
ABresult
1X1
011
000
18
19 2 my $pkg = portable::loader->load($collection);
20 2 my $qpkg = B::perlstring($pkg);
21
22 2 local $@;
23 2 ▶ eval qq{
Subroutine Nature: called CC=2 SCAR=6.9
Subroutine Animals: called CC=2 SCAR=6.9
Branch: 3 branches
BranchTrueFalseTotal
eval "\n\t\tsub ${caller}::$as {\n\t\t\treturn $qpkg unless \@_;\n\t\t\t$qpkg->type_library->get_type(\@_);\n\t\t}\n\t\t1;\n\t" or die "Eww: $@" 2 0 2
unless @_ 1 1 2
unless @_ 18 18 36
24 sub $caller\::$as {
25 return $qpkg unless \@_;
26 $qpkg\->type_library->get_type(\@_);
27 }
28 1;
29 } or die "Eww: $@";
30 }
31  
32  
33 1 1;
« loader.pm ↑ Summary loader/TOML.pm »