Minilla/FileGatherer.pm

filter: Statementstmt 44.7% 30 / 67 Branchbran 0.0% 0 / 12 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 64.2% 9 / 14 Podpod 0.0% 0 / 1 totaltotal 40.2% 39 / 97 CC 10 SCAR 35.9
CC
10
Cov
37%
gather_files
90.0
_topdir
6.0
__ANON__
2.0
CRAP 36.4
« Minilla/WorkDir.pm ↑ Summary Module/BumpVersion.pm »
1 package Minilla::FileGatherer;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use File::pushd;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use ExtUtils::Manifest 1.54 qw(maniskip);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 ▶use Minilla::Git;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 2 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 has exclude_match => (
14 is => 'ro',
15 0 ▶ default => sub { +[ ] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
16 2 );
17  
18 has include_dotfiles => (
19 is => 'ro',
20 0 ▶ default => sub { undef },
Subroutine __ANON__: not called CC=1 SCAR=6.9
21 2 );
22  
23 2 ▶no Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 0 ▶sub gather_files {
Subroutine gather_files: not called CC=9 SCAR=45.0
Pod undocumented
26 0 my ($self, $root) = @_;
27 0 my $guard = pushd($root);
28 0 my @files = grep { _topdir($_) ne 'extlib' }
29 0 grep { not -l $_ }
30 0 map { File::Spec->abs2rel($_, $root) }
31 git_ls_files(), git_submodule_files();
32 0 ▶ if ($self->exclude_match) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->exclude_match) 0 0 0
33 0 ▶ for my $pattern (@{$self->exclude_match || []}) {
Condition0%0/2
$self->exclude_match || []
l!l
00
MC/DC0%0/1
$self->exclude_match || []
$self->exclude_match
Truth table0%0/2
A
A= $self->exclude_match
Aresult
11
00
34 0 @files = grep { _normalize($_) !~ $pattern } @files;
35 }
36 }
37  
38 0 ▶ if (-f 'MANIFEST.SKIP') {
Branch: 1 branch
BranchTrueFalseTotal
if (-f "MANIFEST.SKIP") 0 0 0
39 0 my $skip = maniskip('MANIFEST.SKIP') ;
40 0 @files = grep { !$skip->($_) } @files;
41 }
42 0 ▶ unless ($self->include_dotfiles) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->include_dotfiles) 0 0 0
43 @files = grep {
44 0 !(grep { $_ =~ qr/^\./ } split m!/!, _normalize($_))
45 } @files;
46 }
47 0 ▶ if ($^O eq 'MSWin32') {
Branch: 1 branch
BranchTrueFalseTotal
if ($^O eq "MSWin32") 0 0 0
48 @files = map {
49 0 my $x = $_;
50 0 $x =~ s!\\!/!g;
51 0 $x;
52 } @files;
53 }
54  
55 0 my @submodules = git_submodules;
56 0 ▶ if (@submodules) {
Branch: 1 branch
BranchTrueFalseTotal
if (@submodules) 0 0 0
57 0 for my $filename (@submodules) {
58 0 @files = grep { $_ ne $filename } @files;
59 }
60 }
61  
62 0 return @files;
63 }
64  
65 0 ▶sub _topdir {
Subroutine _topdir: not called CC=2 SCAR=17.9
66 0 my ($path) = @_;
67 0 ▶ [File::Spec->splitdir($path)]->[0] || '';
Branch: 1 branch
BranchTrueFalseTotal
["File::Spec"->splitdir($path)]->[0] or "" 0 0 0
68 }
69  
70 # for Windows
71 0 ▶sub _normalize {
Subroutine _normalize: not called CC=1 SCAR=6.9
72 0 local $_ = shift;
73 0 s!\\!/!g;
74 0 $_;
75 }
76  
77 2 1;
« Minilla/WorkDir.pm ↑ Summary Module/BumpVersion.pm »