lib/BioX/Workflow/Command/run/Utils/Files/TrackChanges.pm

filter: Statementstmt 49.0% 26 / 53 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 61.5% 8 / 13 Podpod 33.3% 1 / 3 totaltotal 46.6% 35 / 75 CC 4 SCAR 17.9
CC
4
Cov
44%
walk_INPUT
20.0
__ANON__
2.0
walk_FILES
2.0
CRAP 6.0
« lib/BioX/Workflow/Command/run/Rules/Directives/Interpolate/Jinja.pm ↑ Summary lib/BioX/Workflow/Command.pm »
1 package BioX::Workflow::Command::run::Utils::Files::TrackChanges;
2  
3 1 ▶use MooseX::App::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Data::Walk 2.01;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use File::Details;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use File::stat;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Time::localtime;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use File::Basename;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use DateTime::Format::Strptime;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 =head3 files
14  
15 Container for list of files just for this rule
16  
17 =cut
18  
19 has 'files' => (
20 traits => ['Array'],
21 is => 'rw',
22 isa => 'ArrayRef',
23 0 ▶ default => sub { [] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
24 1 handles => {
25 has_files => 'count',
26 all_files => 'elements',
27 push_files => 'push',
28 sort_files => 'sort_in_place',
29 uniq_files => 'uniq',
30 },
31 clearer => 'clear_files',
32 );
33  
34 0 ▶sub walk_FILES {
Subroutine walk_FILES: not called CC=1 SCAR=6.9
Pod undocumented
35 0 my $self = shift;
36 0 my $attr = shift;
37  
38 0 $self->pre_FILES( $attr, 'INPUT' );
39 0 $self->add_graph('INPUT');
40 0 $self->clear_files;
41 0 $self->files( [] );
42  
43 0 $self->pre_FILES( $attr, 'OUTPUT' );
44 0 $self->add_graph('OUTPUT');
45 0 $self->clear_files;
46 0 $self->files( [] );
47 }
48  
49 0 ▶sub pre_FILES {
Subroutine pre_FILES: not called CC=1 SCAR=6.9
Pod undocumented
50 0 my $self = shift;
51 0 my $attr = shift;
52 0 my $cond = shift;
53  
54 walk {
55 0 ▶ wanted => sub { $self->walk_INPUT(@_) }
Subroutine __ANON__: not called CC=1 SCAR=6.9
56 },
57 0 $attr->$cond;
58  
59 0 $self->uniq_files;
60 0 $self->sort_files;
61 }
62  
63 =head3 walk_INPUT
64  
65 walk the INPUT/OUTPUT and catch all Path::Tiny references
66  
67 =cut
68  
69 0 ▶sub walk_INPUT {
Subroutine walk_INPUT: not called CC=4 SCAR=30.0
Pod documented
70 0 my $self = shift;
71 0 my $ref = shift;
72  
73 0 ▶ return unless $ref;
Branch: 1 branch
BranchTrueFalseTotal
unless $ref 0 0 0
74  
75 0 my $ref_name = ref($ref);
76 0 ▶ return unless $ref_name;
Branch: 1 branch
BranchTrueFalseTotal
unless $ref_name 0 0 0
77 0 ▶ return unless $ref_name eq 'Path::Tiny';
Branch: 1 branch
BranchTrueFalseTotal
unless $ref_name eq "Path::Tiny" 0 0 0
78  
79 0 my $file = $ref->absolute;
80 0 $file = "$file";
81 0 $self->push_files($file);
82 }
83  
84 1 1;
« lib/BioX/Workflow/Command/run/Rules/Directives/Interpolate/Jinja.pm ↑ Summary lib/BioX/Workflow/Command.pm »