| 1 | package Module::Install::Admin::Find; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 46 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 46 | ▶ | use File::Find (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 46 | ▶ | use Module::Install::Base (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 46 | ▶ | use vars qw{$VERSION @ISA}; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 46 | ▶ | BEGIN { | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 46 | $VERSION = '1.21'; | |||||||||||||||||||||||||||
| 9 | 46 | @ISA = qw(Module::Install::Base); | |||||||||||||||||||||||||||
| 10 | } | ||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 0 | ▶ | sub find_extensions { | ||||||||||||||||||||||||||
|
Subroutine
find_extensions: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 13 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 14 | 0 | $self->_top->find_extensions(@_); | |||||||||||||||||||||||||||
| 15 | } | ||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 0 | ▶ | sub find_in_inc { | ||||||||||||||||||||||||||
|
Subroutine
find_in_inc: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||
| 18 | 0 | my ($self, $pkg) = @_; | |||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 0 | ▶ | unless ($pkg =~ /\.pm$/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 21 | 0 | $pkg =~ s!::!/!g; | |||||||||||||||||||||||||||
| 22 | 0 | $pkg = "$pkg.pm"; | |||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 0 | my @found; | |||||||||||||||||||||||||||
| 26 | 0 | foreach my $inc (@INC) { | |||||||||||||||||||||||||||
| 27 | 0 | ▶ | next if $inc eq $self->_top->{prefix} or ref($inc); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$inc eq $self->_top->{"prefix"} or ref $inc
MC/DC0%0/2
$inc eq $self->_top->{"prefix"} or ref $inc
$inc eq $self->_top->{"prefix"}
ref $inc
Truth table0%0/3
A or B
A= $inc eq $self->_top->{"prefix"}B= ref $inc
| |||||||||||||||||||||||||||||
| 28 | 0 | ▶ | push @found, "$inc/$pkg" if -f "$inc/$pkg"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 0 | ▶ | wantarray ? @found : $found[0]; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 1 | ▶ | sub glob_in_inc { | ||||||||||||||||||||||||||
|
Subroutine
glob_in_inc: called CC=7 SCAR=19.6
Pod
undocumented
| |||||||||||||||||||||||||||||
| 35 | 1 | my ($self, $pkg) = @_; | |||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 1 | ▶ | unless ($pkg =~ /\.pm$/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 38 | 1 | $pkg =~ s!::!/!g; | |||||||||||||||||||||||||||
| 39 | 1 | $pkg = "$pkg.pm"; | |||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | 1 | my @found; | |||||||||||||||||||||||||||
| 43 | 1 | foreach my $inc (@INC) { | |||||||||||||||||||||||||||
| 44 | 10 | ▶ | next if $inc eq $self->_top->{prefix} or ref($inc); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$inc eq $self->_top->{"prefix"} or ref $inc
MC/DC50%1/2
$inc eq $self->_top->{"prefix"} or ref $inc
$inc eq $self->_top->{"prefix"}
ref $inc
Truth table66%2/3
A or B
A= $inc eq $self->_top->{"prefix"}B= ref $inc
| |||||||||||||||||||||||||||||
| 45 | push @found, [ do { | ||||||||||||||||||||||||||||
| 46 | 1 | my $p = $_; | |||||||||||||||||||||||||||
| 47 | 1 | $p =~ s!^\Q$inc\E/!!; | |||||||||||||||||||||||||||
| 48 | 1 | $p =~ s!/!::!g; | |||||||||||||||||||||||||||
| 49 | 1 | $p =~ s!\.pm\Z!!gi; | |||||||||||||||||||||||||||
| 50 | 1 | $p | |||||||||||||||||||||||||||
| 51 | 9 | }, $_ ] for grep -e, glob("$inc/$pkg"); | |||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | 1 | ▶ | wantarray ? @found : $found[0]; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | 0 | ▶ | sub find_files { | ||||||||||||||||||||||||||
|
Subroutine
find_files: not called CC=8 SCAR=42.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 58 | 0 | my ($self, $file, $path) = @_; | |||||||||||||||||||||||||||
| 59 | 0 | ▶ | $path = '' if not defined $path; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 60 | 0 | ▶ | $file = "$path/$file" if length($path); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 61 | 0 | ▶ | if (-f $file) { | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 62 | 0 | return ($file); | |||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||
| 64 | elsif (-d $file) { | ||||||||||||||||||||||||||||
| 65 | 0 | my @files = (); | |||||||||||||||||||||||||||
| 66 | 0 | local *DIR; | |||||||||||||||||||||||||||
| 67 | 0 | ▶ | opendir(DIR, $file) or die "Can't opendir $file"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 68 | 0 | ▶ | while (my $new_file = readdir(DIR)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 69 | 0 | ▶ | next if $new_file =~ /^(\.|\.\.)$/; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 70 | 0 | push @files, $self->find_files($new_file, $file); | |||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||
| 72 | 0 | return @files; | |||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||
| 74 | 0 | return (); | |||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | 46 | 1; | |||||||||||||||||||||||||||