NG/Dir.pm

filter: Statementstmt 57.1% 16 / 28 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 55.5% 5 / 9 Podpod n/a totaltotal 53.8% 21 / 39 CC 2 SCAR 6.2
CC
2
Cov
53%
__ANON__
3.8
__ANON__
2.0
__ANON__
2.0
CRAP 1.9
« NG/Autobox/String.pm ↑ Summary NG/Hashtable.pm »
1 1 ▶use File::Copy::Recursive ();
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use File::Find;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use NG::Array;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use NG::Class;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 NG::Class::def 'NG::Dir' => 'NG::File' => [] => {
6 0 ▶ read => sub {
Subroutine __ANON__: not called CC=2 SCAR=13.4
7 0 my $self = shift;
8 0 ▶ if ( ref( $_[-1] ) eq 'CODE' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $_[-1] eq 'CODE') { } 0 0 0
9 0 my $cb = pop @_;
10 0 my @dirpath = @_;
11 File::Find::find(
12 0 ▶ sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
13 0 $cb->( $File::Find::dir, $_ );
14 },
15 @dirpath
16 0 );
17 }
18 else {
19 0 my $dirpath = shift;
20 0 ▶ return NG::Array->new( glob("$dirpath/*") );
Subroutine BEGIN: called CC=1 SCAR=0.2
21 }
22 },
23 0 ▶ make => sub { shift; File::Copy::Recursive::pathmk(@_) },
Subroutine __ANON__: not called CC=1 SCAR=6.9
24 0 ▶ remove => sub { shift; File::Copy::Recursive::pathrm(@_) },
Subroutine __ANON__: not called CC=1 SCAR=6.9
25 1 };
« NG/Autobox/String.pm ↑ Summary NG/Hashtable.pm »