| 1 | package POE::Component::DirWatch::Role::Signatures; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 3 | ▶ | use POE; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 3 | ▶ | use Moose::Role; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 3 | ▶ | use File::Signature; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 3 | our $VERSION = "0.300004"; | |||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | has signatures => ( | ||||||||||||||||||||
| 10 | is => 'ro', | ||||||||||||||||||||
| 11 | isa => 'HashRef', | ||||||||||||||||||||
| 12 | required => 1, | ||||||||||||||||||||
| 13 | 2 | ▶ | default => sub { {} } | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 14 | 3 | ); | |||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | 12 | ▶ | after _file_callback => sub { | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.1
| |||||||||||||||||||||
| 17 | 12 | my ($self, $file) = @_[OBJECT, ARG0]; | |||||||||||||||||||
| 18 | 12 | ▶ | $self->signatures->{ "$file" } ||= $self->_generate_signature($file); | ||||||||||||||||||
|
Condition66%2/3
$self->signatures->{"$file"} ||= $self->_generate_signature($file)
MC/DC0%0/2
$self->signatures->{"$file"} ||= $self->_generate_signature($file)
$self->signatures->{"$file"}
$self->_generate_signature($file)
Truth table66%2/3
A ||= B
A= $self->signatures->{"$file"}B= $self->_generate_signature($file)
| |||||||||||||||||||||
| 19 | 3 | }; | |||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 6 | ▶ | before _poll => sub { | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||||||||||||
| 22 | 6 | my $sigs = shift->signatures; | |||||||||||||||||||
| 23 | 6 | delete($sigs->{$_}) for grep {! -e $_ } keys %$sigs; | |||||||||||||||||||
| 24 | 3 | }; | |||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 10 | ▶ | sub _generate_signature{ | ||||||||||||||||||
|
Subroutine
_generate_signature: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 27 | 10 | my ($self, $file) = @_; | |||||||||||||||||||
| 28 | 10 | return "" . File::Signature->new( "$file" ) . ""; | |||||||||||||||||||
| 29 | } | ||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | 3 | 1; | |||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | __END__; | ||||||||||||||||||||