MMM/Sync/Ftp.pm

filter: Statementstmt 32.0% 8 / 25 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 2 / 3 Podpod 100% 1 / 1 totaltotal 28.2% 11 / 39 CC 7 SCAR 37.8
CC
7
Cov
23%
buildcmd
56.0
BEGIN
1.0
BEGIN
1.0
CRAP 43.8
« MMM/Daemon.pm ↑ Summary MMM.pm »
1 package MMM::Sync::Ftp;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 our @ISA = qw(MMM::Sync);
6  
7 0 ▶sub buildcmd {
Subroutine buildcmd: not called CC=7 SCAR=40.3
Pod documented
8 0 my ($self) = @_;
9  
10 0 my @command = ('mirrordir', '--no-chown');
11  
12 0 ▶ if ($self->{options}{ftp_defaults}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"options"}{"ftp_defaults"}) 0 0 0
13 0 push(@command, split(/ +/, $self->{ftp_defaults}));
14 }
15  
16 0 ▶ if ($self->{options}{exclude}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"options"}{"exclude"}) 0 0 0
17 0 foreach ( map { split( m/ /, $_ ) } $self->{options}{exclude} ) {
18 0 push( @command, '--exclude-glob', $_ );
19 }
20 }
21  
22 0 ▶ if (!grep { $self->{options}{$_} } (qw(delete-after delete delete-excluded))) {
Branch: 1 branch
BranchTrueFalseTotal
unless (grep {$self->{"options"}{$_};} "delete-after", "delete", "delete-excluded") 0 0 0
23 0 push(@command, '--keep-files');
24 }
25  
26 0 ▶ if ($self->{options}{tempdir}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"options"}{"tempdir"}) 0 0 0
27 0 $ENV{TMPDIR} = $self->{options}{tempdir};
28 }
29  
30 push( @command,
31 $self->{source},
32 $self->{dest}
33 0 );
34  
35 0 ▶ if ($self->{options}{password}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"options"}{"password"}) 0 0 0
36 0 push(@command, '--password', $self->{options}{password});
37 }
38  
39 0 return @command;
40 }
41  
42 3 1;
« MMM/Daemon.pm ↑ Summary MMM.pm »