FTPTurboSync/MixRemote.pm

filter: Statementstmt 37.0% 10 / 27 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 42.8% 3 / 7 Podpod 0.0% 0 / 4 totaltotal 32.5% 13 / 40 CC 2 SCAR 9.7
CC
2
Cov
34%
delete
6.0
isRemote
2.0
newFileObject
2.0
CRAP 2.6
« FTPTurboSync/MixLocal.pm ↑ Summary FTPTurboSync/FactoryOfRemoteObjects.pm »
1 package Net::FTPTurboSync::MixRemote;
2  
3 1 ▶use Exception::Class::Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Exception::Class::TryCatch;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 # something wrong with server or netlink
6 1 ▶use Exception::Class ('NetWorkEx');
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 0 ▶sub isRemote { return 1; }
Subroutine isRemote: not called CC=1 SCAR=6.9
Pod undocumented
9 # delete a file or a dir from remote host and local db
10 0 ▶sub delete {
Subroutine delete: not called CC=2 SCAR=17.9
Pod undocumented
11 0 my ( $self ) = @_;
12 0 my $path = $self->getPath();
13 0 my $ftp = $self->{ftp};
14 0 ▶ if ( ! $self->deleteRemoteObjAndCheck( $path, $ftp ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->deleteRemoteObjAndCheck($path, $ftp)) 0 0 0
15 0 NetWorkEx->throw( "Cannot to remote file '"
16 . $self->getPath() . "'" );
17 }
18 0 $self->{dbh}->deleteFile ( $path );
19 }
20  
21 # remote file doesn't exist yet.
22 0 ▶sub newFileObject {
Subroutine newFileObject: not called CC=1 SCAR=6.9
Pod undocumented
23 0 my ( $class, $ftp, $dbh, $path ) = @_ ;
24 0 my $self = $class->load ( $ftp,
25 $dbh,
26 { size => 0, perms => 0,
27 date => 0, fullname => $path }
28 );
29 0 $self->{_new} = 1;
30 0 return $self;
31 }
32 # load from db
33 0 ▶sub load {
Subroutine load: not called CC=1 SCAR=6.9
Pod undocumented
34 0 my ( $class, $ftp, $dbh, $info ) = @_ ;
35 0 my $self = $class->instantiateObject ( $info->{fullname}, $info );
36 0 $self->{ftp} = $ftp;
37 0 $self->{dbh} = $dbh;
38 0 $self->{_new} = 0;
39 0 return $self;
40 }
41  
42 1 1;
« FTPTurboSync/MixLocal.pm ↑ Summary FTPTurboSync/FactoryOfRemoteObjects.pm »