lib/Win32/Exe/ResourceData.pm

filter: Statementstmt 93.7% 30 / 32 Branchbran 75.0% 9 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 5 totaltotal 80.7% 46 / 57 CC 7 SCAR 10.8
CC
7
Cov
89%
initialize
5.0
Data
3.1
SetData
2.0
CRAP 3.0
« lib/Win32/Exe/Resource/GroupIcon.pm ↑ Summary lib/Win32/Exe/DebugDirectory.pm »
1 # Copyright 2004 by Audrey Tang <cpan@audreyt.org>
2  
3 package Win32::Exe::ResourceData;
4  
5 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 5 ▶use base 'Win32::Exe::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 5 ▶use constant FORMAT => (
Subroutine BEGIN: called CC=1 SCAR=0.0
8 VirtualAddress => 'V',
9 Size => 'V',
10 CodePage => 'V',
11 5 );
12  
13 88 ▶sub Data {
Subroutine Data: called CC=3 SCAR=11.3
Pod undocumented
14 88 my ($self) = @_;
15 88 ▶ return $self->{data} if defined $self->{data};
Branch: 1 branch
BranchTrueFalseTotal
if defined $self->{"data"} 0 88 88
16  
17 88 my $section = $self->first_parent('Resources');
18 88 ▶ my $addr = $self->VirtualAddress or return;
Branch: 1 branch
BranchTrueFalseTotal
my $addr = $self->VirtualAddress or return 88 0 88
19 88 return $section->substr(
20 $addr - $section->VirtualAddress,
21 $self->Size
22 );
23 }
24  
25 0 ▶sub SetData {
Subroutine SetData: not called CC=1 SCAR=6.9
Pod undocumented
26 0 my ($self, $data) = @_;
27 0 $self->{data} = $data;
28 }
29  
30 86 ▶sub object {
Subroutine object: called CC=1 SCAR=0.0
Pod undocumented
31 86 my ($self) = @_;
32 86 return $self->{object};
33 }
34  
35 112 ▶sub path {
Subroutine path: called CC=1 SCAR=0.0
Pod undocumented
36 112 my ($self) = @_;
37 112 return $self->parent->path;
38 }
39  
40 112 ▶sub initialize {
Subroutine initialize: called CC=5 SCAR=16.1
Pod undocumented
41 112 my ($self) = @_;
42  
43 112 ▶ my ($base) = $self->path or return;
Branch: 1 branch
BranchTrueFalseTotal
my($base) = $self->path or return 80 32 112
44 80 ▶ $base =~ /^#RT_(?!ICON$)(\w+)$/ or return;
Branch: 1 branch
BranchTrueFalseTotal
$base =~ /^#RT_(?!ICON$)(\w+)$/ or return 48 32 80
45 48 ▶ $self->VirtualAddress or return;
Branch: 1 branch
BranchTrueFalseTotal
$self->VirtualAddress or return 24 24 48
46  
47 24 my $data = $self->Data;
48 24 my $class = ucfirst(lc($1));
49 24 $class =~ s/_(\w)/\U$1/g;
50 24 ▶ $class = $self->require_class("Resource::$class") or return;
Branch: 1 branch
BranchTrueFalseTotal
$class = $self->require_class("Resource::$class") or return 24 0 24
51  
52 24 my $obj = $class->new(\$data, { parent => $self });
53 24 $obj->initialize;
54 24 $self->{object} = $obj;
55 }
56  
57 5 1;
« lib/Win32/Exe/Resource/GroupIcon.pm ↑ Summary lib/Win32/Exe/DebugDirectory.pm »