blib/lib/underscore.pm

filter: Statementstmt 96.1% 25 / 26 Branchbran 50.0% 3 / 6 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 9 / 9 Podpod n/a totaltotal 86.3% 38 / 44 CC 5 SCAR 10.1
CC
5
Cov
85%
unimport
5.5
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
↑ Summary
1 package underscore;
2 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 our $VERSION = sprintf "%d.%02d", q$Revision: 0.1 $ =~ /(\d+)/g;
6  
7 1 ▶sub TIESCALAR{
Subroutine TIESCALAR: called CC=1 SCAR=0.0
8 1 my ($pkg, $code, $msg) = @_;
9 1 bless [$code, $msg], $pkg;
10 }
11  
12 1 ▶sub unimport {
Subroutine unimport: called CC=5 SCAR=17.1
13 1 my $pkg = shift;
14 1 my $action = shift;
15 2 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
16 my $code =
17 ref $action ? $action
18 0 ▶ : $action ? \&{ 'Carp::' . $action }
Branch: 2 branches
BranchTrueFalseTotal
ref $action ? : 0 1 1
$action ? : 0 1 1
19 : \&Carp::croak;
20 1 ▶ my $msg = shift || '$_ is forbidden';
Condition50%1/2
shift() || '$_ is forbidden'
l!l
01
MC/DC0%0/1
shift() || '$_ is forbidden'
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
21 1 ▶ untie $_ if tied $_;
Branch: 1 branch
BranchTrueFalseTotal
if tied $_ 0 1 1
22 1 tie $_, __PACKAGE__, $code, $msg;
23 }
24  
25 1 ▶sub import{ untie $_ }
Subroutine import: called CC=1 SCAR=0.0
26  
27 4 ▶sub FETCH{ $_[0]->[0]($_[0]->[1]) }
Subroutine FETCH: called CC=1 SCAR=0.0
28 2 ▶sub STORE{ $_[0]->[0]($_[0]->[1]) }
Subroutine STORE: called CC=1 SCAR=0.0
29  
30 2 1; # End of underscore
31 __END__
↑ Summary