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