DirWatch/Role/Signatures.pm

filter: Statementstmt 100% 22 / 22 Branchbran n/a Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 91.1% 31 / 34 CC 3 SCAR 3.7
CC
3
Cov
96%
__ANON__
2.0
__ANON__
2.0
BEGIN
1.0
CRAP 1.5
« DirWatch/New.pm ↑ Summary
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)
l!l&&r!l&&!r
1020
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)
ABresult
1X1
011
000
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__;
« DirWatch/New.pm ↑ Summary