| 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
| |||||||||||
| 17 | { | ||||||||||
| 18 | 195 | ▶ | if ( $r->is_dir() ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 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
| |||||||||||
| 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
| |||||||||||
| 46 | { | ||||||||||
| 47 | } | ||||||||||
| 48 | |||||||||||
| 49 | 2 | return $self->_results; | |||||||||
| 50 | } | ||||||||||
| 51 | |||||||||||
| 52 | 4 | 1; | |||||||||
| 53 | |||||||||||
| 54 | __END__ | ||||||||||