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

filter: Statementstmt 100% 27 / 27 Branchbran 100% 2 / 2 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 2 totaltotal 95.4% 42 / 44 CC 3 SCAR 4.7
CC
3
Cov
100%
__ANON__
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.6
↑ Summary
1 package File::Find::Rule::DWG;
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 CAD::AutoCAD::Detect qw(detect_dwg_file);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 4 our $VERSION = 0.02;
10  
11 # Detect DWG.
12 sub File::Find::Rule::dwg {
13 1 ▶ my $file_find_rule = shift;
Subroutine dwg: called CC=1 SCAR=0.0
Pod undocumented
14 1 my $self = $file_find_rule->_force_object;
15 return $self->file->exec(sub{
16 4 ▶ my $file = shift;
Subroutine __ANON__: called CC=1 SCAR=0.0
17 4 return detect_dwg_file($file);
18 1 });
19 }
20  
21 # Detect DWG magic.
22 sub File::Find::Rule::dwg_magic {
23 1 ▶ my ($file_find_rule, $acad_magic) = @_;
Subroutine dwg_magic: called CC=1 SCAR=0.0
Pod undocumented
24 1 my $self = $file_find_rule->_force_object;
25 return $self->file->exec(sub{
26 4 ▶ my $file = shift;
Subroutine __ANON__: called CC=3 SCAR=11.0
27 4 my $detected_acad_magic = detect_dwg_file($file);
28 4 ▶ if ($detected_acad_magic && $detected_acad_magic eq $acad_magic) {
Branch: 1 branch
BranchTrueFalseTotal
if ($detected_acad_magic and $detected_acad_magic eq $acad_magic) { } 1 3 4
Condition100%3/3
$detected_acad_magic and $detected_acad_magic eq $acad_magic
!ll&&!rl&&r
121
MC/DC100%2/2
$detected_acad_magic and $detected_acad_magic eq $acad_magic
$detected_acad_magic $detected_acad_magic eq $acad_magic
Truth table100%3/3
A and B
A= $detected_acad_magicB= $detected_acad_magic eq $acad_magic
ABresult
0X0
100
111
29 1 return 1;
30 } else {
31 3 return 0;
32 }
33 1 });
34 }
35  
36 4 1;
37  
38 __END__
↑ Summary