Box/Net/Message.pm

filter: Statementstmt 33.3% 15 / 45 Branchbran 0.0% 0 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 4 / 8 Podpod 50.0% 2 / 4 totaltotal 30.4% 21 / 69 CC 7 SCAR 25.5
CC
7
Cov
26%
loadBody
30.0
unique
6.0
loadHead
6.0
CRAP 12.9
« Box/Search/Grep.pm ↑ Summary Box.pm »
1 # This code is part of Perl distribution Mail-Box version 4.02.
2 # The POD got stripped from this file by OODoc version 3.06.
3 # For contributors see file ChangeLog.
4  
5 # This software is copyright (c) 2001-2026 by Mark Overmeer.
6  
7 # This is free software; you can redistribute it and/or modify it under
8 # the same terms as the Perl 5 programming language system itself.
9 # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later
10  
11  
12 package Mail::Box::Net::Message;{
13 2 our $VERSION = '4.02';
14 }
15  
16 2 ▶use parent 'Mail::Box::Message';
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 2 ▶use Log::Report 'mail-box', import => [ qw/__x error trace/ ];
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 #--------------------
24  
25 sub init($)
26 0 ▶{ my ($self, $args) = @_;
Subroutine init: not called CC=1 SCAR=6.9
Pod undocumented
27 0 $self->SUPER::init($args);
28 0 $self->unique($args->{unique});
29 0 $self;
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 sub loadHead()
42 0 ▶{ my $self = shift;
Subroutine loadHead: not called CC=2 SCAR=17.9
Pod undocumented
43 0 my $head = $self->head;
44 0 ▶ $head->isDelayed or return $head;
Branch: 1 branch
BranchTrueFalseTotal
$head->isDelayed or return $head 0 0 0
45  
46 0 my $folder = $self->folder;
47  
48 0 $folder->lazyPermitted(1);
49 0 $self->readFromParser($self->parser);
50 0 $folder->lazyPermitted(0);
51  
52 0 trace "Loaded delayed head for message ". $self->messageId;
53 0 $self->head;
54 }
55  
56  
57 sub loadBody()
58 0 ▶{ my $self = shift;
Subroutine loadBody: not called CC=5 SCAR=34.0
Pod documented
59 0 my $msgid = $self->messageId;
60  
61 0 my $body = $self->body;
62 0 ▶ $body->isDelayed or return;
Branch: 1 branch
BranchTrueFalseTotal
$body->isDelayed or return 0 0 0
63  
64 0 my $head = $self->head;
65 0 my $parser = $self->parser;
66  
67 0 ▶ if($head->isDelayed)
Branch: 1 branch
BranchTrueFalseTotal
if ($head->isDelayed) { } 0 0 0
68 0 ▶ { $head = $self->readHead($parser)
Branch: 1 branch
BranchTrueFalseTotal
$head = $self->readHead($parser) or &error(&__x("unable to read delayed head for {msgid}.", "msgid", $msgid)) 0 0 0
69 or error __x"unable to read delayed head for {msgid}.", msgid => $msgid;
70  
71 0 trace "Loaded delayed head for $msgid.";
72 0 $self->head($head);
73 }
74 else
75 0 { my ($begin, $end) = $body->fileLocation;
76 0 $parser->filePosition($begin);
77 }
78  
79 0 ▶ my $newbody = $self->readBody($parser, $head)
Branch: 1 branch
BranchTrueFalseTotal
my $newbody = $self->readBody($parser, $head) or &error(&__x("unable to read delayed body for {msgid}.", "msgid", $msgid)) 0 0 0
80 or error __x"unable to read delayed body for {msgid}.", msgid => $msgid;
81  
82 0 trace "Loaded delayed body for $msgid.";
83 0 $self->storeBody($newbody->contentInfoFrom($head));
84 }
85  
86 2 1;
« Box/Search/Grep.pm ↑ Summary Box.pm »