lib/Win32/Exe/Base.pm

filter: Statementstmt 100% 23 / 23 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 4 totaltotal 89.7% 35 / 39 CC 3 SCAR 3.4
CC
3
Cov
100%
align
2.0
pad
2.0
BEGIN
1.0
CRAP 1.4
« lib/Win32/Exe/ResourceTable.pm ↑ Summary lib/Win32/Exe/Resource/Icon.pm »
1 # Copyright 2004 by Audrey Tang <cpan@audreyt.org>
2  
3 package Win32::Exe::Base;
4  
5 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 5 ▶use base 'Parse::Binary';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 5 ▶use constant BASE_CLASS => 'Win32::Exe';
Subroutine BEGIN: called CC=1 SCAR=0.0
8 5 ▶use constant FORMAT => (
Subroutine BEGIN: called CC=1 SCAR=0.0
9 Data => 'a',
10 5 );
11  
12 417 ▶sub align {
Subroutine align: called CC=2 SCAR=6.9
Pod undocumented
13 417 my ($self, $value, $boundary) = @_;
14 417 ▶ my $n = ($value % $boundary) or return $value;
Branch: 1 branch
BranchTrueFalseTotal
my $n = $value % $boundary or return $value 107 310 417
15 107 return($value + $boundary - $n);
16 }
17  
18 106 ▶sub pad {
Subroutine pad: called CC=2 SCAR=6.9
Pod undocumented
19 106 my ($self, $value, $bounary) = @_;
20 106 ▶ my $x = length($value) % $bounary or return '';
Branch: 1 branch
BranchTrueFalseTotal
my $x = length($value) % $bounary or return "" 34 72 106
21 34 return "\0" x ($bounary - $x);
22 }
23  
24 230 ▶sub decode_ucs2 {
Subroutine decode_ucs2: called CC=1 SCAR=0.0
Pod undocumented
25 230 my ($self, $string) = @_;
26 230 return join('', map chr($_), unpack("v*", $string));
27 }
28  
29 46 ▶sub encode_ucs2 {
Subroutine encode_ucs2: called CC=1 SCAR=0.0
Pod undocumented
30 46 my ($self, $string) = @_;
31 46 return pack("v*", map ord($_), split(//, $string));
32 }
33  
34 5 1;
« lib/Win32/Exe/ResourceTable.pm ↑ Summary lib/Win32/Exe/Resource/Icon.pm »