| 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::Search;{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 2 | our $VERSION = '4.02'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 2 | ▶ | use parent 'Mail::Reporter'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
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/ ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | #-------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | sub init($) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 12 | ▶ | { my ($self, $args) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
init: called CC=18 SCAR=30.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 12 | $self->SUPER::init($args); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 12 | ▶ | my $in = $args->{in} || 'BODY'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$args->{'in'} || 'BODY'
MC/DC0%0/1
$args->{'in'} || 'BODY'
$args->{'in'}
Truth table50%1/2
A
A= $args->{'in'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 12 | ▶ | @$self{ qw/MBS_check_head MBS_check_body/ } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | = $in eq 'BODY' ? (0,1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | : $in eq 'HEAD' ? (1,0) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | : $in eq 'MESSAGE' ? (1,1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | : error __x"search in BODY, HEAD or MESSAGE, not {what UNKNOWN}.", what => $in; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 12 | ▶ | ! $self->{MBS_check_head} || $self->can('inHead') or error __x"cannot search in header."; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
not $self->{"MBS_check_head"} or $self->can("inHead")
MC/DC0%0/2
not $self->{"MBS_check_head"} or $self->can("inHead")
not $self->{"MBS_check_head"}
$self->can("inHead")
Truth table66%2/3
not(A) or B
A= not $self->{"MBS_check_head"}B= $self->can("inHead")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 12 | ▶ | ! $self->{MBS_check_body} || $self->can('inBody') or error __x"cannot search in body."; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
not $self->{"MBS_check_body"} or $self->can("inBody")
MC/DC0%0/2
not $self->{"MBS_check_body"} or $self->can("inBody")
not $self->{"MBS_check_body"}
$self->can("inBody")
Truth table66%2/3
not(A) or B
A= not $self->{"MBS_check_body"}B= $self->can("inBody")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 12 | my $deliver = $args->{deliver}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | $self->{MBS_deliver} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 518 | ▶ | = ref $deliver eq 'CODE' ? sub { $deliver->($self, $_[0]) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | : !defined $deliver ? undef | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 0 | ▶ | : $deliver eq 'DELETE' ? sub { $_[0]->{part}->toplevel->label(deleted => 1) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 12 | ▶ | : error __x"don't know how to deliver results in {what UNKNOWN}.", what => $deliver; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 12 | ▶ | my $logic = $args->{logical} || 'REPLACE'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$args->{'logical'} || 'REPLACE'
MC/DC0%0/1
$args->{'logical'} || 'REPLACE'
$args->{'logical'}
Truth table50%1/2
A
A= $args->{'logical'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 12 | $self->{MBS_negative} = $logic =~ s/\s*NOT\s*$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 12 | $self->{MBS_logical} = $logic; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 12 | $self->{MBS_label} = $args->{label}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 12 | ▶ | $self->{MBS_binaries} = $args->{binaries} || 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$args->{'binaries'} || 0
MC/DC100%1/1
$args->{'binaries'} || 0
$args->{'binaries'}
Truth table100%2/2
A
A= $args->{'binaries'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 12 | ▶ | $self->{MBS_limit} = $args->{limit} || 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$args->{'limit'} || 0
MC/DC100%1/1
$args->{'limit'} || 0
$args->{'limit'}
Truth table100%2/2
A
A= $args->{'limit'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 12 | ▶ | $self->{MBS_decode} = $args->{decode} || 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$args->{'decode'} || 1
MC/DC0%0/1
$args->{'decode'} || 1
$args->{'decode'}
Truth table50%1/2
A
A= $args->{'decode'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 12 | $self->{MBS_no_deleted} = not $args->{deleted}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 12 | ▶ | $self->{MBS_delayed} = exists $args->{delayed} ? $args->{delayed} : 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 12 | ▶ | $self->{MBS_multiparts} = exists $args->{multiparts} ? $args->{multiparts} : 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 12 | $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | #-------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 63 | ▶ | sub deliver() { $_[0]->{MBS_deliver} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
deliver: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 25 | ▶ | sub doMultiparts() { $_[0]->{MBS_multiparts} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
doMultiparts: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 343 | ▶ | sub parseDelayed() { $_[0]->{MBS_delayed} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parseDelayed: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 376 | ▶ | sub skipDeleted() { $_[0]->{MBS_no_deleted} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
skipDeleted: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | #-------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | sub search(@) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 14 | ▶ | { my ($self, $object) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
search: called CC=26 SCAR=34.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 14 | my $label = $self->{MBS_label}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 14 | my $limit = $self->{MBS_limit}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | my @messages | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 14 | ▶ | = ref $object eq 'ARRAY' ? @$object | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | : $object->isa('Mail::Box') ? $object->messages | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | : $object->isa('Mail::Message') ? ($object) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | : $object->isa('Mail::Box::Thread::Node') ? $object->threadMessages | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | : error __x"expect messages to search, not {what UNKNOWN}.", what => $object; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 14 | my $take = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 14 | ▶ | if($limit < 0) { $take = -$limit; @messages = reverse @messages } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 0 | elsif($limit > 0) { $take = $limit } | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 1 | ▶ | elsif(!defined $label && !wantarray && !$self->deliver) {$take = 1 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition83%5/6
defined $label || wantarray || $self->deliver
defined $label or wantarray
MC/DC66%2/3
defined $label || wantarray || $self->deliver
defined $label
wantarray
$self->deliver
Truth table75%3/4
A or B || C
A= defined $labelB= wantarrayC= $self->deliver
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 14 | my $logic = $self->{MBS_logical}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 14 | my @selected; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 14 | my $count = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 14 | foreach my $message (@messages) | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 376 | ▶ | { next if $self->skipDeleted && $message->isDeleted; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$self->skipDeleted and $message->isDeleted
MC/DC100%2/2
$self->skipDeleted and $message->isDeleted
$self->skipDeleted
$message->isDeleted
Truth table100%3/3
A and B
A= $self->skipDeletedB= $message->isDeleted
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 343 | ▶ | next unless $self->parseDelayed || !$message->isDelayed; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$self->parseDelayed or not $message->isDelayed
MC/DC0%0/2
$self->parseDelayed or not $message->isDelayed
$self->parseDelayed
not $message->isDelayed
Truth table33%1/3
A or not(B)
A= $self->parseDelayedB= not $message->isDelayed
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 343 | ▶ | my $set = defined $label ? $message->label($label) : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | my $selected | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | = $set && $logic eq 'OR' ? 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | : !$set && $logic eq 'AND' ? 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 343 | ▶ | : $self->{MBS_negative} ? ! $self->searchPart($message) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
Condition33%2/6
$set and $logic eq "OR"
not $set and $logic eq "AND"
MC/DC0%0/2
$set and $logic eq "OR"
$set
$logic eq "OR"
MC/DC0%0/2
not $set and $logic eq "AND"
not $set
$logic eq "AND"
Truth table33%1/3
A and B
A= $setB= $logic eq "OR"
Truth table33%1/3
not(A) and B
A= not $setB= $logic eq "AND"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | : $self->searchPart($message); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 343 | ▶ | $message->label($label => $selected) if defined $label; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 343 | ▶ | if($selected) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 167 | { push @selected, $message; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 167 | $count++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 167 | ▶ | last if $take && $count == $take; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$take and $count == $take
MC/DC100%2/2
$take and $count == $take
$take
$count == $take
Truth table100%3/3
A and B
A= $takeB= $count == $take
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 14 | ▶ | $limit < 0 ? reverse @selected : @selected; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | sub searchPart($) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 376 | ▶ | { my ($self, $part) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
searchPart: called CC=18 SCAR=30.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 376 | my $matched = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | $matched = $self->inHead($part, $part->head) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 376 | ▶ | if $self->{MBS_check_head}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 376 | ▶ | return $matched unless $self->{MBS_check_body}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 335 | ▶ | return $matched if $matched && !$self->deliver; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$matched and not $self->deliver
MC/DC0%0/2
$matched and not $self->deliver
$matched
not $self->deliver
Truth table66%2/3
A and not(B)
A= $matchedB= not $self->deliver
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 335 | my $body = $part->body; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 335 | my @bodies; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | # Handle multipart parts. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 335 | ▶ | if($body->isMultipart) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 25 | ▶ | { $self->doMultiparts or return $matched; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 24 | @bodies = ($body->preamble, $body->epilogue); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 24 | foreach my $piece (grep defined, $body->parts) | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 33 | ▶ | { next if $piece->isDelayed && ! $self->parseDelayed; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$piece->isDelayed and not $self->parseDelayed
MC/DC0%0/2
$piece->isDelayed and not $self->parseDelayed
$piece->isDelayed
not $self->parseDelayed
Truth table33%1/3
A and not(B)
A= $piece->isDelayedB= not $self->parseDelayed
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 33 | $matched += $self->searchPart($piece); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 33 | ▶ | return $matched if $matched && !$self->deliver; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$matched and not $self->deliver
MC/DC0%0/2
$matched and not $self->deliver
$matched
not $self->deliver
Truth table66%2/3
A and not(B)
A= $matchedB= not $self->deliver
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | elsif($body->isNested) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 0 | ▶ | { $self->doMultiparts or return $matched; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | $matched += $self->searchPart($body->nested); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 310 | { @bodies = ($body); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | # Handle normal bodies. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 334 | foreach (grep defined, @bodies) | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 349 | ▶ | { next if !$self->{MBS_binaries} && $_->isBinary; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
not $self->{"MBS_binaries"} and $_->isBinary
MC/DC100%2/2
not $self->{"MBS_binaries"} and $_->isBinary
not $self->{"MBS_binaries"}
$_->isBinary
Truth table100%3/3
not(A) and B
A= not $self->{"MBS_binaries"}B= $_->isBinary
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 326 | ▶ | my $body = $self->{MBS_decode} ? $_->decoded : $_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 326 | my $inbody = $self->inBody($part, $body); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 326 | $matched += $inbody; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 334 | $matched; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 0 | ▶ | sub inHead(@) { $_[0]->notImplemented } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
inHead: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 0 | ▶ | sub inBody(@) { $_[0]->notImplemented } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
inBody: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | #-------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 0 | ▶ | sub printMatch($) { $_[0]->notImplemented } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
printMatch: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||