| 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::Message::Head::Subset; | ||||||||||||||||||||||||||||
| 10 | 9 | ▶ | use vars '$VERSION'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 9 | $VERSION = '3.009'; | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 9 | ▶ | use base 'Mail::Message::Head'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 9 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 16 | 9 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | use Object::Realize::Later | ||||||||||||||||||||||||||||
| 19 | 9 | becomes => 'Mail::Message::Head::Complete', | |||||||||||||||||||||||||||
| 20 | realize => 'load', | ||||||||||||||||||||||||||||
| 21 | 9 | ▶ | believe_caller => 1; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 9 | ▶ | use Date::Parse qw(str2time); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | sub count($) | ||||||||||||||||||||||||||||
| 27 | 0 | ▶ | { my ($self, $name) = @_; | ||||||||||||||||||||||||||
|
Subroutine
count: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 28 | 0 | ▶ | my @values = $self->get($name) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 29 | or return $self->load->count($name); | ||||||||||||||||||||||||||||
| 30 | 0 | scalar @values; | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | sub get($;$) | ||||||||||||||||||||||||||||
| 35 | 0 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
get: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 0 | ▶ | if(wantarray) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 38 | 0 | { my @values = $self->SUPER::get(@_); | |||||||||||||||||||||||||||
| 39 | 0 | ▶ | return @values if @values; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||
| 41 | else | ||||||||||||||||||||||||||||
| 42 | 0 | { my $value = $self->SUPER::get(@_); | |||||||||||||||||||||||||||
| 43 | 0 | ▶ | return $value if defined $value; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | 0 | $self->load->get(@_); | |||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | #------------------------------------------- | ||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | sub guessBodySize() | ||||||||||||||||||||||||||||
| 53 | 0 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
guessBodySize: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | 0 | my $cl = $self->SUPER::get('Content-Length'); | |||||||||||||||||||||||||||
| 56 | 0 | ▶ | return $1 if defined $cl && $cl =~ m/(\d+)/; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $cl and $cl =~ /(\d+)/
MC/DC0%0/2
defined $cl and $cl =~ /(\d+)/
defined $cl
$cl =~ /(\d+)/
Truth table0%0/3
A and B
A= defined $clB= $cl =~ /(\d+)/
| |||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | 0 | my $lines = $self->SUPER::get('Lines'); # 40 chars per lines | |||||||||||||||||||||||||||
| 59 | 0 | ▶ | return $1*40 if defined $lines && $lines =~ m/(\d+)/; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $lines and $lines =~ /(\d+)/
MC/DC0%0/2
defined $lines and $lines =~ /(\d+)/
defined $lines
$lines =~ /(\d+)/
Truth table0%0/3
A and B
A= defined $linesB= $lines =~ /(\d+)/
| |||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | 0 | undef; | |||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | #------------------------------------------- | ||||||||||||||||||||||||||||
| 65 | # Be careful not to trigger loading: this is not the thoroughness | ||||||||||||||||||||||||||||
| 66 | # we want from this method. | ||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | sub guessTimestamp() | ||||||||||||||||||||||||||||
| 69 | 0 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
guessTimestamp: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||
| 70 | 0 | ▶ | return $self->{MMHS_timestamp} if $self->{MMHS_timestamp}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | 0 | my $stamp; | |||||||||||||||||||||||||||
| 73 | 0 | ▶ | if(my $date = $self->SUPER::get('date')) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 74 | 0 | { $stamp = str2time($date, 'GMT'); | |||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | 0 | ▶ | unless($stamp) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 78 | 0 | { foreach ($self->SUPER::get('received')) | |||||||||||||||||||||||||||
| 79 | 0 | { $stamp = str2time($_, 'GMT'); | |||||||||||||||||||||||||||
| 80 | 0 | ▶ | last if $stamp; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 81 | } | ||||||||||||||||||||||||||||
| 82 | } | ||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||
| 84 | 0 | $self->{MMHS_timestamp} = $stamp; | |||||||||||||||||||||||||||
| 85 | } | ||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||
| 87 | #------------------------------------------- | ||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||
| 89 | 0 | ▶ | sub load() { $_[0] = $_[0]->message->loadHead } | ||||||||||||||||||||||||||
|
Subroutine
load: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||
| 91 | 9 | 1; | |||||||||||||||||||||||||||