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

filter: Statementstmt 89.4% 34 / 38 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 92.3% 12 / 13 Podpod 100% 5 / 5 totaltotal 88.3% 53 / 60 CC 3 SCAR 4.1
CC
3
Cov
86%
display_address
3.2
_process_subdirectory
2.0
BEGIN
1.0
CRAP 1.5
« blib/lib/Email/Outlook/Message.pm ↑ Summary
1 package Email::Outlook::Message::AddressInfo;
2 =head1 NAME
3  
4 Email::Outlook::Message::AddressInfo - Handle address 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--2020 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 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
40 9 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
41 9 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
42 9 $VERSION = "0.920";
43 9 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
44 9 ▶use base 'Email::Outlook::Message::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
45  
46 9 our $MAP_ADDRESSITEM_FILE = {
47 '3001' => "NAME", # Real name
48 '3002' => "TYPE", # Address type
49 '403D' => "TYPE2", # Address type TODO: Not used
50 '3003' => "ADDRESS", # Address
51 '403E' => "ADDRESS2", # Address TODO: Not used
52 '39FE' => "SMTPADDRESS", # SMTP Address variant
53 };
54  
55 sub _property_map {
56 32 ▶ return $MAP_ADDRESSITEM_FILE;
Subroutine _property_map: called CC=1 SCAR=0.0
57 }
58  
59 # DIR Entries: There should be none.
60 sub _process_subdirectory {
61 0 ▶ my ($self, $pps) = @_;
Subroutine _process_subdirectory: not called CC=1 SCAR=6.9
62 0 $self->_warn_about_unknown_directory($pps);
63 0 return;
64 }
65  
66 11 ▶sub name { my $self = shift; return $self->property('NAME') }
Subroutine name: called CC=1 SCAR=0.0
Pod documented
67 5 ▶sub address_type { my $self = shift; return $self->property('TYPE') }
Subroutine address_type: called CC=1 SCAR=0.0
Pod documented
68 5 ▶sub address { my $self = shift; return $self->property('ADDRESS') }
Subroutine address: called CC=1 SCAR=0.0
Pod documented
69 5 ▶sub smtp_address { my $self = shift; return $self->property('SMTPADDRESS') }
Subroutine smtp_address: called CC=1 SCAR=0.0
Pod documented
70  
71 sub display_address {
72 5 ▶ my $self = shift;
Subroutine display_address: called CC=3 SCAR=11.6
Pod documented
73 5 my $addresstext = $self->name . " <";
74 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
75 0 $addresstext .= $self->smtp_address;
76 } elsif ($self->address_type eq "SMTP") {
77 5 $addresstext .= $self->address;
78 }
79 5 $addresstext .= ">";
80 5 return $addresstext;
81 }
82  
83 6 ▶sub _property_stream_header_length { return 8; }
Subroutine _property_stream_header_length: called CC=1 SCAR=0.0
84  
85 9 1;
« blib/lib/Email/Outlook/Message.pm ↑ Summary