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