blib/lib/lib/require/all.pm

filter: Statementstmt 100% 23 / 23 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 96.9% 32 / 33 CC 5 SCAR 8.8
CC
5
Cov
96%
import
4.0
__ANON__
2.0
BEGIN
1.0
CRAP 2.4
↑ Summary
1 package lib::require::all;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use 5.008_001;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 our $VERSION = '0.01';
6  
7 1 ▶use lib ();
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use File::Find;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶sub import {
Subroutine import: called CC=4 SCAR=13.9
11 1 my($class, @dir) = @_;
12 1 ▶ @dir = ('lib') unless @dir;
Branch: 1 branch
BranchTrueFalseTotal
unless @dir 1 0 1
13 1 lib->import(@dir);
14  
15 1 for my $dir (@dir) {
16 1 my @files;
17 1 ▶ File::Find::find({ no_chdir => 1, wanted => sub { push @files, $_ if /\.pm$/ } }, $dir);
Subroutine __ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
if /\.pm$/ 1 3 4
18  
19 1 for my $file (@files) {
20 1 $file =~ s/^\Q$dir\E[\/\\]//;
21 1 require $file;
22 }
23 }
24 }
25  
26 1 1;
27 __END__
↑ Summary