blib/lib/File/Find/Rule/DjVu.pm

filter: Statementstmt 96.1% 25 / 26 Branchbran 50.0% 1 / 2 Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 2 totaltotal 83.7% 36 / 43 CC 3 SCAR 5.3
CC
3
Cov
90%
__ANON__
3.3
djvu_chunk
1.0
BEGIN
1.0
CRAP 1.7
↑ Summary
1 package File::Find::Rule::DjVu;
2  
3 4 ▶use base qw(File::Find::Rule);
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 4 ▶use DjVu::Detect qw(detect_djvu_chunk detect_djvu_file);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 4 our $VERSION = 0.01;
10  
11 1 ▶sub File::Find::Rule::djvu {
Subroutine djvu: called CC=1 SCAR=0.0
Pod undocumented
12 1 my $file_find_rule = shift;
13 1 my $self = $file_find_rule->_force_object;
14 2 ▶ return $self->file->exec(sub{
Subroutine __ANON__: called CC=1 SCAR=0.0
15 2 my $file = shift;
16 2 return detect_djvu_file($file);
17 1 });
18 }
19  
20 3 ▶sub File::Find::Rule::djvu_chunk {
Subroutine djvu_chunk: called CC=1 SCAR=0.2
Pod undocumented
21 3 my ($file_find_rule, $djvu_chunk) = @_;
22 3 my $self = $file_find_rule->_force_object;
23 6 ▶ return $self->file->exec(sub{
Subroutine __ANON__: called CC=3 SCAR=12.0
24 6 my $file = shift;
25 6 ▶ if (detect_djvu_file($file) && detect_djvu_chunk($file, $djvu_chunk)) {
Branch: 1 branch
BranchTrueFalseTotal
if (detect_djvu_file($file) and detect_djvu_chunk($file, $djvu_chunk)) { } 0 6 6
Condition66%2/3
detect_djvu_file($file) and detect_djvu_chunk($file, $djvu_chunk)
!ll&&!rl&&r
330
MC/DC0%0/2
detect_djvu_file($file) and detect_djvu_chunk($file, $djvu_chunk)
detect_djvu_file($file) detect_djvu_chunk($file, $djvu_chunk)
Truth table66%2/3
A and B
A= detect_djvu_file($file)B= detect_djvu_chunk($file, $djvu_chunk)
ABresult
0X0
100
111
26 0 return 1;
27 } else {
28 6 return 0;
29 }
30 3 });
31 }
32  
33 4 1;
34  
35 __END__
↑ Summary