Embra/Plugin/PruneFiles.pm

filter: Statementstmt 97.1% 34 / 35 Branchbran 62.5% 5 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 90.9% 10 / 11 Podpod n/a totaltotal 90.7% 49 / 54 CC 5 SCAR 7.0
CC
5
Cov
91%
exclude_file
4.0
mvp_multivalue_args
2.0
__ANON__
2.0
CRAP 2.0
« Embra/Plugin/DetectYamlFrontMatter.pm ↑ Summary Embra/App/Command/collate.pm »
1 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package App::Embra::Plugin::PruneFiles;
5 1 $App::Embra::Plugin::PruneFiles::VERSION = '0.001'; # TRIAL
6 # ABSTRACT: exclude files from the site
7  
8 1 ▶use List::MoreUtils qw< any >;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Method::Signatures;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12  
13  
14 has 'filename' => (
15 is => 'ro',
16 0 ▶ default => sub { [] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
17 1 );
18  
19 1 ▶method mvp_multivalue_args() { qw< filename >; }
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine mvp_multivalue_args: called CC=2 SCAR=7.0
Branch: 1 branch
BranchTrueFalseTotal
if scalar @_ > 0 0 1 1
20  
21 1 ▶method exclude_file( $file ) {
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine exclude_file: called CC=4 SCAR=13.9
Branch: 2 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 3 3
if scalar @_ > 1 0 3 3
22 3 ▶ return 1 if any { $_ eq $file->name } @{ $self->filename };
Subroutine __ANON__: called CC=1 SCAR=0.0
Branch: 1 branch
BranchTrueFalseTotal
if &any(sub { $_ eq $file->name; } , @{$self->filename;}) 1 2 3
23 2 return;
24 }
25  
26 1 with 'App::Embra::Role::FilePruner';
27  
28 1 1;
29  
30 __END__
« Embra/Plugin/DetectYamlFrontMatter.pm ↑ Summary Embra/App/Command/collate.pm »