| 1 | package Net::FTPTurboSync::FileLeaf; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use Net::FTPTurboSync::FileObject; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use base qw(Net::FTPTurboSync::FileObject); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 0 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 0 | my ($class, $path, $perms, $moddate, $size) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 0 | my $self = $class->SUPER::new( $path, $perms ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 0 | $self->setModDate ( $moddate ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 0 | $self->setSize ( $size ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 0 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | # return date of last modification in the epoch format ( integer ) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 0 | ▶ | sub getModDate { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
getModDate: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 0 | my ( $self ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 0 | return $self->{_moddate}; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 0 | ▶ | sub setModDate { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
setModDate: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 0 | my ( $self, $newmoddate ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 0 | return $self->{_moddate} = $newmoddate ; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | # return size of the file | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | ▶ | sub getSize { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
getSize: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 0 | my ( $self ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | return $self->{_size}; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | ▶ | sub setSize { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
setSize: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | my ( $self, $newsize ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | return $self->{_size} = $newsize ; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | # return true if objects are coincidence | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 0 | ▶ | sub equal { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
equal: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | # one of these is remote | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | my ( $remotef, $localf ) = Net::FTPTurboSync::FileObject->sortByLocation( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 0 | ▶ | return !( $remotef->isNew() or | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/9
$remotef->isNew || $remotef->getModDate < $localf->getModDate || $remotef->getSize != $localf->getSize || $remotef->getPerms != $localf->getPerms
$remotef->isNew or $remotef->getModDate < $localf->getModDate or $remotef->getSize != $localf->getSize
$remotef->isNew or $remotef->getModDate < $localf->getModDate
MC/DC0%0/4
$remotef->isNew || $remotef->getModDate < $localf->getModDate || $remotef->getSize != $localf->getSize || $remotef->getPerms != $localf->getPerms
$remotef->isNew
$remotef->getModDate < $localf->getModDate
$remotef->getSize != $localf->getSize
$remotef->getPerms != $localf->getPerms
Truth table0%0/5
A or B or C || D
A= $remotef->isNewB= $remotef->getModDate < $localf->getModDateC= $remotef->getSize != $localf->getSizeD= $remotef->getPerms != $localf->getPerms
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | $remotef->getModDate() < $localf->getModDate() or | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | $remotef->getSize() != $localf->getSize() or | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | $remotef->getPerms() != $localf->getPerms() | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||