Box/IMAP4/Head.pm

filter: Statementstmt 51.5% 17 / 33 Branchbran 0.0% 0 / 14 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 71.4% 5 / 7 Podpod 50.0% 1 / 2 totaltotal 37.7% 23 / 61 SCAR 36.6
CC
10
Cov
34%
get
110.0
init
2.0
BEGIN
1.0
CRAP 38.7
« Server/IMAP4/User.pm ↑ Summary Server/IMAP4/List.pm »
1 # Copyrights 2001-2023 by [Mark Overmeer].
2 # For other contributors see ChangeLog.
3 # See the manual pages for details on the licensing terms.
4 # Pod stripped from pm file by OODoc 2.03.
5 # This code is part of distribution Mail-Box-IMAP4. Meta-POD processed with
6 # OODoc into POD and HTML manual-pages. See README.md
7 # Copyright Mark Overmeer. Licensed under the same terms as Perl itself.
8  
9 package Mail::Box::IMAP4::Head;
10 2 ▶use vars '$VERSION';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 $VERSION = '3.008';
12  
13 2 ▶use base 'Mail::Message::Head';
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 2 ▶use Date::Parse;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20  
21 sub init($$)
22 0 ▶{ my ($self, $args) = @_;
Subroutine init: not called CC=1 SCAR=6.9
Pod undocumented
23 0 $self->SUPER::init($args);
24  
25 0 $self->{MBIH_c_fields} = $args->{cache_fields};
26 0 $self;
27 }
28  
29  
30 sub get($;$)
31 0 ▶{ my ($self, $name, $index) = @_;
Subroutine get: not called CC=10 SCAR=47.0
Pod documented
32  
33 0 ▶ if(not $self->{MBIH_c_fields}) { ; }
Branch: 2 branches
BranchTrueFalseTotal
if (not $self->{'MBIH_c_fields'}) { } 0 0 0
elsif (wantarray) { } 0 0 0
34 elsif(wantarray)
35 0 { my @values = $self->SUPER::get(@_);
36 0 ▶ return @values if @values;
Branch: 1 branch
BranchTrueFalseTotal
if @values 0 0 0
37 }
38 else
39 0 { my $value = $self->SUPER::get(@_);
40 0 ▶ return $value if defined $value;
Branch: 1 branch
BranchTrueFalseTotal
if defined $value 0 0 0
41 }
42  
43 # Something here, playing with ENVELOPE, may improve the performance
44 # as well.
45 0 my $imap = $self->message->folder->transporter;
46 0 my $uidl = $self->message->unique;
47 0 my @fields = $imap->getFields($uidl, $name);
48  
49 0 ▶ if(@fields && $self->{MBIH_c_fields})
Branch: 1 branch
BranchTrueFalseTotal
if (@fields and $self->{"MBIH_c_fields"}) 0 0 0
Condition0%0/3
@fields and $self->{"MBIH_c_fields"}
!ll&&!rl&&r
000
MC/DC0%0/2
@fields and $self->{"MBIH_c_fields"}
@fields $self->{"MBIH_c_fields"}
Truth table0%0/3
A and B
A= @fieldsB= $self->{"MBIH_c_fields"}
ABresult
0X0
100
111
50 0 { $self->addNoRealize($_) for @fields
51 }
52  
53 0 ▶ defined $index ? $fields[$index]
Branch: 2 branches
BranchTrueFalseTotal
defined $index ? : 0 0 0
wantarray ? : 0 0 0
54 : wantarray ? @fields
55 : $fields[0];
56 }
57  
58 sub guessBodySize() {undef}
59  
60 sub guessTimestamp() {undef}
61  
62 #------------------------------------------
63  
64 2 1;
« Server/IMAP4/User.pm ↑ Summary Server/IMAP4/List.pm »