tiny.pm

filter: Statementstmt 100% 14 / 14 Branchbran 50.0% 2 / 4 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 76.0% 19 / 25 CC 5 SCAR 15.7
CC
5
Cov
81%
import
5.6
unimport
1.0
CRAP 4.8
↑ Summary tiny/findbin.pm »
1 package lib::tiny;
2  
3 # use strict; # this works but is disabled for production, since it doesn't gain any thing in this mod and adds appx 184K to memory
4 2 $lib::tiny::VERSION = 0.7;
5  
6 3 ▶sub import {
Subroutine import: called CC=5 SCAR=17.2
7 3 shift;
8 3 my %seen;
9 3 for ( reverse @_ ) {
10 5 ▶ next if !defined $_ || $_ eq '';
Branch: 1 branch
BranchTrueFalseTotal
if not defined $_ or $_ eq "" 0 5 5
Condition33%1/3
not defined $_ or $_ eq ""
l!l&&r!l&&!r
005
MC/DC0%0/2
not defined $_ or $_ eq ""
not defined $_ $_ eq ""
Truth table33%1/3
not(A) or B
A= not defined $_B= $_ eq ""
ABresult
1X1
011
000
11 5 ▶ unshift @INC, $_ if -d $_;
Branch: 1 branch
BranchTrueFalseTotal
if -d $_ 5 0 5
12  
13 # if we can do this without Config and 'tiny' File::Spec-ness to properly join their names into a path...
14 # handle '$_/@{'inc_version_list'} here
15 # unshift @INC, "$_/$archname") if -d "$_/$archname/auto";
16 # unshift @INC, "$_/$version") if -d "$_/$version";
17 # unshift @INC, "$_/$version/$archname") if -d "$_/$version/$archname";
18 }
19 3 @INC = grep { $seen{$_}++ == 0 } @INC;
20 }
21  
22 3 ▶sub unimport {
Subroutine unimport: called CC=1 SCAR=0.0
23 3 shift;
24 3 my %ditch;
25 3 @ditch{@_} = ();
26  
27 # if import ever does version/archname/inc_version_list paths we need to remove them here
28 3 @INC = grep { !exists $ditch{$_} } @INC;
29 }
30  
31 2 1;
↑ Summary tiny/findbin.pm »