Box/Net/Message.pm

filter: Statementstmt 35.7% 20 / 56 Branchbran 0.0% 0 / 16 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 6 / 10 Podpod 50.0% 2 / 4 totaltotal 32.5% 28 / 86 CC 9 SCAR 28.4
CC
9
Cov
28%
loadBody
42.0
loadHead
12.0
unique
6.0
CRAP 17.1
« Box/Mbox.pm ↑ Summary Box/Test.pm »
1 # Copyrights 2001-2020 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.02.
5 # This code is part of distribution Mail-Box. 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::Net::Message;
10 1 ▶use vars '$VERSION';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 $VERSION = '3.009';
12  
13 1 ▶use base 'Mail::Box::Message';
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 1 ▶use File::Copy;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21  
22 sub init($)
23 0 ▶{ my ($self, $args) = @_;
Subroutine init: not called CC=1 SCAR=6.9
Pod undocumented
24  
25 0 $self->SUPER::init($args);
26  
27 0 $self->unique($args->{unique});
28 0 $self;
29 }
30  
31 #-------------------------------------------
32  
33  
34 sub unique(;$)
35 0 ▶{ my $self = shift;
Subroutine unique: not called CC=2 SCAR=17.9
Pod documented
36 0 ▶ @_ ? $self->{MBNM_unique} = shift : $self->{MBNM_unique};
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
37 }
38  
39 #-------------------------------------------
40  
41  
42 #-------------------------------------------
43  
44 sub loadHead()
45 0 ▶{ my $self = shift;
Subroutine loadHead: not called CC=3 SCAR=24.8
Pod undocumented
46 0 my $head = $self->head;
47 0 ▶ return $head unless $head->isDelayed;
Branch: 1 branch
BranchTrueFalseTotal
unless $head->isDelayed 0 0 0
48  
49 0 my $folder = $self->folder;
50 0 $folder->lazyPermitted(1);
51  
52 0 ▶ my $parser = $self->parser or return;
Branch: 1 branch
BranchTrueFalseTotal
my $parser = $self->parser or return 0 0 0
53 0 $self->readFromParser($parser);
54  
55 0 $folder->lazyPermitted(0);
56  
57 0 $self->log(PROGRESS => 'Loaded delayed head.');
58 0 $self->head;
59 }
60  
61 #-------------------------------------------
62  
63  
64 sub loadBody()
65 0 ▶{ my $self = shift;
Subroutine loadBody: not called CC=6 SCAR=37.4
Pod documented
66  
67 0 my $body = $self->body;
68 0 ▶ return $body unless $body->isDelayed;
Branch: 1 branch
BranchTrueFalseTotal
unless $body->isDelayed 0 0 0
69  
70 0 my $head = $self->head;
71 0 ▶ my $parser = $self->parser or return;
Branch: 1 branch
BranchTrueFalseTotal
my $parser = $self->parser or return 0 0 0
72  
73 0 ▶ if($head->isDelayed)
Branch: 1 branch
BranchTrueFalseTotal
if ($head->isDelayed) { } 0 0 0
74 0 { $head = $self->readHead($parser);
75 0 ▶ if(defined $head)
Branch: 1 branch
BranchTrueFalseTotal
if (defined $head) { } 0 0 0
76 0 { $self->log(PROGRESS => 'Loaded delayed head.');
77 0 $self->head($head);
78 }
79 else
80 0 { $self->log(ERROR => 'Unable to read delayed head.');
81 0 return;
82 }
83 }
84 else
85 0 { my ($begin, $end) = $body->fileLocation;
86 0 $parser->filePosition($begin);
87 }
88  
89 0 my $newbody = $self->readBody($parser, $head);
90 0 ▶ unless(defined $newbody)
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $newbody) 0 0 0
91 0 { $self->log(ERROR => 'Unable to read delayed body.');
92 0 return;
93 }
94  
95 0 $self->log(PROGRESS => 'Loaded delayed body.');
96 0 $self->storeBody($newbody->contentInfoFrom($head));
97 }
98  
99 #-------------------------------------------
100  
101 1 1;
« Box/Mbox.pm ↑ Summary Box/Test.pm »