blib/lib/File/Find/CaseCollide.pm

filter: Statementstmt 95.0% 38 / 40 Branchbran 87.5% 7 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 1 / 1 totaltotal 94.6% 53 / 56 CC 6 SCAR 10.5
CC
6
Cov
94%
_iter
5.1
find
2.0
BEGIN
1.0
CRAP 2.9
« Build ↑ Summary blib/lib/Test/File/Find/CaseCollide.pm »
1 package File::Find::CaseCollide;
2 4 $File::Find::CaseCollide::VERSION = '0.0.2';
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use 5.014;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use File::Find::Object ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 4 has '_results' => ( is => 'rw' );
10 4 has '_ffo' => ( is => 'rw' );
11 4 has 'dir' => ( is => 'ro' );
12  
13 sub _iter
14 {
15 197 ▶ my ($self) = @_;
Subroutine _iter: called CC=5 SCAR=16.2
16 197 ▶ if ( my $r = $self->_ffo->next_obj() )
Branch: 1 branch
BranchTrueFalseTotal
if (my $r = $self->_ffo->next_obj) 195 2 197
17 {
18 195 ▶ if ( $r->is_dir() )
Branch: 1 branch
BranchTrueFalseTotal
if ($r->is_dir) 67 128 195
19 {
20 67 my %found;
21 67 foreach my $fn ( @{ $self->_ffo->get_current_node_files_list() } )
22 {
23 193 push @{ $found{ lc $fn } }, $fn;
24 }
25 67 my @positives = grep { @{ $found{$_} } > 1 } ( keys %found );
26  
27 67 ▶ if (@positives)
Branch: 1 branch
BranchTrueFalseTotal
if (@positives) 0 67 67
28 {
29 $self->_results->{ $r->path() } =
30 0 +{ map { $_ => $found{$_} } @positives };
31 }
32 }
33 195 return 1;
34 }
35 2 return;
36 }
37  
38 sub find
39 {
40 2 ▶ my ($self) = @_;
Subroutine find: called CC=2 SCAR=6.9
Pod documented
41  
42 2 $self->_results( {} );
43 2 $self->_ffo( File::Find::Object->new( {}, $self->dir ) );
44  
45 2 ▶ while ( $self->_iter )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->_iter) 195 2 197
46 {
47 }
48  
49 2 return $self->_results;
50 }
51  
52 4 1;
53  
54 __END__
« Build ↑ Summary blib/lib/Test/File/Find/CaseCollide.pm »