blib/lib/Email/Outlook/Message/AddressInfo.pm

filter: Statementstmt 88.2% 30 / 34 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 91.6% 11 / 12 Podpod 100% 5 / 5 totaltotal 87.2% 48 / 55 CC 3 SCAR 4.3
CC
3
Cov
84%
display_address
3.2
_process_subdirectory
2.0
BEGIN
1.0
CRAP 1.5
« Build ↑ Summary
1 package Email::Outlook::Message::AddressInfo;
2 =head1 NAME
3  
4 Email::Outlook::Message::AddressInfo - Handle addres data in .msg files
5  
6 =head1 DESCRIPTION
7  
8 This is an internal module of Email::Outlook::Message. It is a subclass of
9 Email::Outlook::Message::Base.
10  
11 =head1 METHODS
12  
13 =over 8
14  
15 =item B<address()>
16  
17 =item B<address_type()>
18  
19 =item B<display_address()>
20  
21 =item B<name()>
22  
23 =item B<smtp_address()>
24  
25 =back
26  
27 =head1 AUTHOR
28  
29 Matijs van Zuijlen, C<matijs@matijs.net>
30  
31 =head1 COPYRIGHT AND LICENSE
32  
33 Copyright 2002--2014 by Matijs van Zuijlen
34  
35 This module is free software; you can redistribute it and/or modify
36 it under the same terms as Perl itself.
37  
38 =cut
39 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
40 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
41 8 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
42 8 ▶use base 'Email::Outlook::Message::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
43  
44 8 our $MAP_ADDRESSITEM_FILE = {
45 '3001' => "NAME", # Real name
46 '3002' => "TYPE", # Address type
47 '403D' => "TYPE2", # Address type TODO: Not used
48 '3003' => "ADDRESS", # Address
49 '403E' => "ADDRESS2", # Address TODO: Not used
50 '39FE' => "SMTPADDRESS", # SMTP Address variant
51 };
52  
53 sub _property_map {
54 30 ▶ return $MAP_ADDRESSITEM_FILE;
Subroutine _property_map: called CC=1 SCAR=0.0
55 }
56  
57 # DIR Entries: There should be none.
58 sub _process_subdirectory {
59 0 ▶ my ($self, $pps) = @_;
Subroutine _process_subdirectory: not called CC=1 SCAR=6.9
60 0 $self->_warn_about_unknown_directory($pps);
61 0 return;
62 }
63  
64 10 ▶sub name { my $self = shift; return $self->property('NAME') }
Subroutine name: called CC=1 SCAR=0.0
Pod documented
65 5 ▶sub address_type { my $self = shift; return $self->property('TYPE') }
Subroutine address_type: called CC=1 SCAR=0.0
Pod documented
66 5 ▶sub address { my $self = shift; return $self->property('ADDRESS') }
Subroutine address: called CC=1 SCAR=0.0
Pod documented
67 5 ▶sub smtp_address { my $self = shift; return $self->property('SMTPADDRESS') }
Subroutine smtp_address: called CC=1 SCAR=0.0
Pod documented
68  
69 sub display_address {
70 5 ▶ my $self = shift;
Subroutine display_address: called CC=3 SCAR=11.6
Pod documented
71 5 my $addresstext = $self->name . " <";
72 5 ▶ if (defined ($self->smtp_address)) {
Branch: 2 branches
BranchTrueFalseTotal
if (defined $self->smtp_address) { } 0 5 5
elsif ($self->address_type eq 'SMTP') { } 5 0 5
73 0 $addresstext .= $self->smtp_address;
74 } elsif ($self->address_type eq "SMTP") {
75 5 $addresstext .= $self->address;
76 }
77 5 $addresstext .= ">";
78 5 return $addresstext;
79 }
80  
81 5 ▶sub _property_stream_header_length { return 8; }
Subroutine _property_stream_header_length: called CC=1 SCAR=0.0
82  
83 8 1;
« Build ↑ Summary