« blib/lib/Mail/AuthenticationResults/Header.pm
↑ Summary
lib/Mail/AuthenticationResults/Parser.pm »
| 1 | package Mail::AuthenticationResults::Header::Base; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | # ABSTRACT: Base class for modelling parts of the Authentication Results Header | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 30 | require 5.008; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 30 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 30 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 30 | our $VERSION = '2.20260216'; # VERSION | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 30 | ▶ | use Scalar::Util qw{ weaken refaddr }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 30 | ▶ | use JSON; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 30 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 30 | ▶ | use Clone qw{ clone }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 30 | ▶ | use Mail::AuthenticationResults::Header::Group; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 30 | ▶ | use Mail::AuthenticationResults::FoldableHeader; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 30 | ▶ | use Mail::AuthenticationResults::Header::Entry; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 30 | ▶ | use Mail::AuthenticationResults::Header::SubEntry; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 30 | ▶ | use Mail::AuthenticationResults::Header::Comment; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 254 | ▶ | sub _HAS_KEY{ return 0; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_HAS_KEY: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 34 | ▶ | sub _HAS_VALUE{ return 0; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_HAS_VALUE: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 285 | ▶ | sub _HAS_CHILDREN{ return 0; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_HAS_CHILDREN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 0 | ▶ | sub _ALLOWED_CHILDREN{ # uncoverable subroutine | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_ALLOWED_CHILDREN: not called (uncoverable) CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | # does not run in Base as HAS_CHILDREN returns 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | return 0; # uncoverable statement | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 1950 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 1950 | my ( $class ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 1950 | my $self = {}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 1950 | bless $self, $class; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 1950 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 389 | ▶ | sub set_key { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_key: called CC=7 SCAR=19.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 389 | my ( $self, $key ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 389 | ▶ | croak 'Does not have key' if ! $self->_HAS_KEY(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 385 | ▶ | croak 'Key cannot be undefined' if ! defined $key; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 383 | ▶ | croak 'Key cannot be empty' if $key eq q{}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 381 | ▶ | croak 'Invalid characters in key' if $key =~ /"/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 379 | ▶ | croak 'Invalid characters in key' if $key =~ /\n/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 377 | ▶ | croak 'Invalid characters in key' if $key =~ /\r/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 375 | $self->{ 'key' } = $key; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 375 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 1239 | ▶ | sub key { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
key: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 1239 | my ( $self ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 1239 | ▶ | croak 'Does not have key' if ! $self->_HAS_KEY(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 1233 | ▶ | return q{} if ! defined $self->{ 'key' }; #5.8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 1229 | return $self->{ 'key' }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 39 | ▶ | sub safe_set_value { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
safe_set_value: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 39 | my ( $self, $value ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 39 | ▶ | $value = q{} if ! defined $value; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 39 | $value =~ s/\t/ /g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 39 | $value =~ s/\n/ /g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 39 | $value =~ s/\r/ /g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 39 | $value =~ s/\(/ /g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 39 | $value =~ s/\)/ /g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 39 | $value =~ s/\\/ /g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 39 | $value =~ s/"/ /g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 39 | $value =~ s/;/ /g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 39 | $value =~ s/^\s+//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 39 | $value =~ s/\s+$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | #$value =~ s/ /_/g; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 39 | $self->set_value( $value ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 39 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 385 | ▶ | sub set_value { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_value: called CC=6 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 385 | my ( $self, $value ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 385 | ▶ | croak 'Does not have value' if ! $self->_HAS_VALUE(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 381 | ▶ | croak 'Value cannot be undefined' if ! defined $value; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | #croak 'Value cannot be empty' if $value eq q{}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 378 | ▶ | croak 'Invalid characters in value' if $value =~ /"/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 375 | ▶ | croak 'Invalid characters in value' if $value =~ /\n/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 372 | ▶ | croak 'Invalid characters in value' if $value =~ /\r/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 369 | $self->{ 'value' } = $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 369 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 1577 | ▶ | sub value { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
value: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 1577 | my ( $self ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 1577 | ▶ | croak 'Does not have value' if ! $self->_HAS_VALUE(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 1576 | ▶ | return q{} if ! defined $self->{ 'value' }; # 5.8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 1517 | return $self->{ 'value' }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 551 | ▶ | sub stringify { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
stringify: called CC=6 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 551 | my ( $self, $value ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 551 | my $string = $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 551 | ▶ | $string = q{} if ! defined $string; #5.8; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 551 | my $strict_quotes = $self->strict_quotes; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 551 | ▶ | if ( ( $strict_quotes && $string =~ /[\s\t \(\);=<>@,:\\\/\[\]\?]/ ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%9/9
$strict_quotes and $string =~ m<[\s\t \(\);=<>\@,:\\/\[\]\?]> or not $strict_quotes and $string =~ /[\s\t \(\);=]/
$strict_quotes and $string =~ m<[\s\t \(\);=<>\@,:\\/\[\]\?]>
not $strict_quotes and $string =~ /[\s\t \(\);=]/
MC/DC75%3/4
$strict_quotes and $string =~ m<[\s\t \(\);=<>\@,:\\/\[\]\?]> or not $strict_quotes and $string =~ /[\s\t \(\);=]/
$strict_quotes
$string =~ m<[\s\t \(\);=<>\@,:\\/\[\]\?]>
not $strict_quotes
$string =~ /[\s\t \(\);=]/
Truth table57%4/7
A and B or not(C) and D
A= $strict_quotesB= $string =~ m<[\s\t \(\);=<>\@,:\\/\[\]\?]>C= not $strict_quotesD= $string =~ /[\s\t \(\);=]/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | || ( !$strict_quotes && $string =~ /[\s\t \(\);=]/ ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 37 | $string = '"' . $string . '"'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 551 | return $string; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 3345 | ▶ | sub children { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
children: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 3345 | my ( $self ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 3345 | ▶ | croak 'Does not have children' if ! $self->_HAS_CHILDREN(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 3343 | ▶ | return [] if ! defined $self->{ 'children' }; #5.8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 1336 | return $self->{ 'children' }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 19 | ▶ | sub orphan { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
orphan: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 19 | my ( $self, $parent ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 19 | ▶ | croak 'Child does not have a parent' if ! exists $self->{ 'parent' }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 11 | delete $self->{ 'parent' }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 11 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 1 | ▶ | sub copy_children_from { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
copy_children_from: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 1 | my ( $self, $object ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 1 | for my $original_entry (@{$object->children()}) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 1 | my $entry = clone $original_entry; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 1 | ▶ | $entry->orphan if exists $entry->{ 'parent' };; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 1 | $self->add_child( $entry ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 786 | ▶ | sub add_parent { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_parent: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 786 | my ( $self, $parent ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 786 | ▶ | return if ( ref $parent eq 'Mail::AuthenticationResults::Header::Group' ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 392 | ▶ | croak 'Child already has a parent' if exists $self->{ 'parent' }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 388 | ▶ | croak 'Cannot add parent' if ! $parent->_ALLOWED_CHILDREN( $self ); # uncoverable branch true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | # Does not run as test is also done in add_child before add_parent is called. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 388 | $self->{ 'parent' } = $parent; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 388 | weaken $self->{ 'parent' }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 388 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 2471 | ▶ | sub parent { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parent: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 2471 | my ( $self ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 2471 | return $self->{ 'parent' }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | 16 | ▶ | sub remove_child { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
remove_child: called CC=8 SCAR=20.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 16 | my ( $self, $child ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 16 | ▶ | croak 'Does not have children' if ! $self->_HAS_CHILDREN(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 16 | ▶ | croak 'Cannot add child' if ! $self->_ALLOWED_CHILDREN( $child ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | 16 | ▶ | croak 'Cannot add a class as its own parent' if refaddr $self == refaddr $child; # uncoverable branch true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | # Does not run as there are no ALLOWED_CHILDREN results which permit this | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | 16 | my @children; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | 16 | my $child_removed = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 16 | foreach my $mychild ( @{ $self->{ 'children' } } ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 39 | ▶ | if ( refaddr $child == refaddr $mychild ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | 16 | ▶ | if ( ref $self ne 'Mail::AuthenticationResults::Header::Group' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 10 | $child->orphan(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 16 | $child_removed = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | 23 | push @children, $mychild; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 16 | my $children = $self->{ 'children' }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | 16 | ▶ | croak 'Not a child of this class' if ! $child_removed; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 16 | $self->{ 'children' } = \@children; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | 16 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 860 | ▶ | sub add_child { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_child: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 860 | my ( $self, $child ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 860 | ▶ | croak 'Does not have children' if ! $self->_HAS_CHILDREN(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | 831 | ▶ | croak 'Cannot add child' if ! $self->_ALLOWED_CHILDREN( $child ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 806 | ▶ | croak 'Cannot add a class as its own parent' if refaddr $self == refaddr $child; # uncoverable branch true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | # Does not run as there are no ALLOWED_CHILDREN results which permit this | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 806 | $child->add_parent( $self ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 802 | push @{ $self->{ 'children' } }, $child; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | 802 | return $child; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 2 | ▶ | sub add_entry { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_entry: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | 2 | my ($self, $key, $value) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | 2 | my $child = Mail::AuthenticationResults::Header::Entry->new->set_key($key)->safe_set_value($value); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | 2 | $self->add_child($child); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 2 | return $child; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | 2 | ▶ | sub add_sub_entry { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_sub_entry: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 2 | my ($self, $key, $value) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | 2 | my $child = Mail::AuthenticationResults::Header::SubEntry->new->set_key($key)->safe_set_value($value); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | 2 | $self->add_child($child); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | 1 | return $child; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | 2 | ▶ | sub add_comment { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_comment: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | 2 | my ($self, $value) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | 2 | my $child = Mail::AuthenticationResults::Header::Comment->new->safe_set_value($value); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | 2 | $self->add_child($child); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 2 | return $child; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 1256 | ▶ | sub ancestor { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
ancestor: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | 1256 | my ( $self ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | 1256 | my $depth = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | 1256 | my $ancestor = $self->parent(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | 1256 | my $eldest = $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | 1256 | ▶ | while ( defined $ancestor ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 1206 | $eldest = $ancestor; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | 1206 | $ancestor = $ancestor->parent(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | 1206 | $depth++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | 1256 | return ( $eldest, $depth ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | 999 | ▶ | sub strict_quotes { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
strict_quotes: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | 999 | my ( $self ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | 999 | ▶ | return $self->{ 'strict_quotes' } if defined $self->{ 'strict_quotes' }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | 964 | my ( $eldest, $depth ) = $self->ancestor(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | 964 | ▶ | return 0 if $depth == 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | 448 | return $eldest->strict_quotes; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | 2 | ▶ | sub set_strict_quotes { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_strict_quotes: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | 2 | my ( $self, $value ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | 2 | ▶ | $self->{ 'strict_quotes' } = $value ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | 2 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | 292 | ▶ | sub as_string_prefix { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
as_string_prefix: called CC=6 SCAR=18.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | 292 | my ( $self, $header ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | 292 | my ( $eldest, $depth ) = $self->ancestor(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | 292 | my $indents = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | 292 | ▶ | if ( $eldest->can( 'indent_by' ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | 292 | $indents = $eldest->indent_by(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | 292 | my $eol = "\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | 292 | ▶ | if ( $eldest->can( 'eol' ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | 292 | $eol = $eldest->eol(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | 292 | my $indent = ' '; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | 292 | my $added = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | 292 | ▶ | if ( $eldest->can( 'indent_on' ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | 292 | ▶ | if ( $eldest->indent_on( ref $self ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | 117 | $header->space( $eol ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | 117 | $header->space( ' ' x ( $indents * $depth ) ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | 117 | $added = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | 292 | ▶ | $header->space( ' ' ) if ! $added; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | 292 | return $indent; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | 46 | ▶ | sub _as_hashref { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_as_hashref: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | 46 | my ( $self ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | 46 | my $type = lc ref $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | 46 | $type =~ s/^(.*::)//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | 46 | my $hashref = { 'type' => $type }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | 46 | ▶ | $hashref->{'key'} = $self->key() if $self->_HAS_KEY(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | 46 | ▶ | $hashref->{'value'} = $self->value() if $self->_HAS_VALUE(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | 46 | ▶ | if ( $self->_HAS_CHILDREN() ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | 34 | my @children = map { $_->_as_hashref() } @{ $self->children() }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | 34 | $hashref->{'children'} = \@children; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | 46 | return $hashref; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | 2 | ▶ | sub as_json { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
as_json: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | 2 | my ( $self ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | 2 | my $J = JSON->new(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | 2 | $J->canonical(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | 2 | return $J->encode( $self->_as_hashref() ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | 76 | ▶ | sub as_string { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
as_string: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | 76 | my ( $self ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | 76 | my $header = Mail::AuthenticationResults::FoldableHeader->new(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | 76 | $self->build_string( $header ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | 76 | return $header->as_string(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | 263 | ▶ | sub build_string { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
build_string: called CC=8 SCAR=20.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | 263 | my ( $self, $header ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | 263 | ▶ | if ( ! $self->key() ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | 2 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | 261 | $header->string( $self->stringify( $self->key() ) ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | 261 | ▶ | if ( $self->value() ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | 239 | $header->assignment( '=' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | 239 | $header->string( $self->stringify( $self->value() ) ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | elsif ( $self->value() eq '0' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | 2 | $header->assignment( '=' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | 2 | $header->string( '0' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | elsif ( $self->value() eq q{} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | # special case none here | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | 20 | ▶ | if ( $self->key() ne 'none' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | 18 | $header->assignment( '=' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | 18 | $header->string( '""' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | 261 | ▶ | if ( $self->_HAS_CHILDREN() ) { # uncoverable branch false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | # There are no classes which run this code without having children | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | 261 | foreach my $child ( @{$self->children()} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | 197 | $child->as_string_prefix( $header ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | 197 | $child->build_string( $header ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | 261 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | 1273 | ▶ | sub search { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
search: called CC=38 SCAR=36.6
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | 1273 | my ( $self, $search ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | 1273 | my $group = Mail::AuthenticationResults::Header::Group->new(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | 1273 | my $match = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | 1273 | ▶ | if ( exists( $search->{ 'key' } ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | 792 | ▶ | if ( $self->_HAS_KEY() ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | 574 | ▶ | if ( ref $search->{ 'key' } eq 'Regexp' && $self->key() =~ m/$search->{'key'}/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition100%3/3
ref $search->{"key"} eq "Regexp" and $self->key =~ /$search->{"key"}/
MC/DC100%2/2
ref $search->{"key"} eq "Regexp" and $self->key =~ /$search->{"key"}/
ref $search->{"key"} eq "Regexp"
$self->key =~ /$search->{"key"}/
Truth table100%3/3
A and B
A= ref $search->{"key"} eq "Regexp"B= $self->key =~ /$search->{"key"}/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | 1 | ▶ | $match = $match && 1; # uncoverable statement | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$match && 1
MC/DC0%0/1
$match && 1
$match
Truth table50%1/2
A
A= $match
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | # $match is always 1 at this point, left this way for consistency | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | elsif ( lc $search->{ 'key' } eq lc $self->key() ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | 84 | ▶ | $match = $match && 1; # uncoverable statement | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$match && 1
MC/DC0%0/1
$match && 1
$match
Truth table50%1/2
A
A= $match
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | # $match is always 1 at this point, left this way for consistency | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | 489 | $match = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | 218 | $match = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 387 | 1273 | ▶ | if ( exists( $search->{ 'value' } ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 388 | 694 | ▶ | $search->{ 'value' } = '' if ! defined $search->{ 'value' }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 389 | 694 | ▶ | if ( $self->_HAS_VALUE() ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 390 | 675 | ▶ | if ( ref $search->{ 'value' } eq 'Regexp' && $self->value() =~ m/$search->{'value'}/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition100%3/3
ref $search->{"value"} eq "Regexp" and $self->value =~ /$search->{"value"}/
MC/DC100%2/2
ref $search->{"value"} eq "Regexp" and $self->value =~ /$search->{"value"}/
ref $search->{"value"} eq "Regexp"
$self->value =~ /$search->{"value"}/
Truth table100%3/3
A and B
A= ref $search->{"value"} eq "Regexp"B= $self->value =~ /$search->{"value"}/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 391 | 1 | ▶ | $match = $match && 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$match && 1
MC/DC0%0/1
$match && 1
$match
Truth table50%1/2
A
A= $match
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 392 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 393 | elsif ( lc $search->{ 'value' } eq lc $self->value() ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 394 | 156 | ▶ | $match = $match && 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$match && 1
MC/DC100%1/1
$match && 1
$match
Truth table100%2/2
A
A= $match
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 395 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 396 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 397 | 518 | $match = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 398 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 399 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 400 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 401 | 19 | $match = 0; # uncoverable statement | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 402 | # There are no code paths with the current classes which end up here | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 403 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 404 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 405 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 406 | 1273 | ▶ | if ( exists( $search->{ 'authserv_id' } ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 407 | 87 | ▶ | if ( $self->_HAS_VALUE() ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 408 | 82 | ▶ | if ( lc ref $self eq 'mail::authenticationresults::header' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 409 | 16 | ▶ | my $authserv_id = eval{ $self->value()->value() } || q{}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
eval {
do {
$self->value->value
}
} || ''
MC/DC0%0/1
eval {
do {
$self->value->value
}
} || ''
eval {
do {
$self->value->value
}
}
Truth table50%1/2
A
A= eval {
do {
$self->value->value
}
}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 410 | 16 | ▶ | if ( ref $search->{ 'authserv_id' } eq 'Regexp' && $authserv_id =~ m/$search->{'authserv_id'}/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition100%3/3
ref $search->{"authserv_id"} eq "Regexp" and $authserv_id =~ /$search->{"authserv_id"}/
MC/DC100%2/2
ref $search->{"authserv_id"} eq "Regexp" and $authserv_id =~ /$search->{"authserv_id"}/
ref $search->{"authserv_id"} eq "Regexp"
$authserv_id =~ /$search->{"authserv_id"}/
Truth table100%3/3
A and B
A= ref $search->{"authserv_id"} eq "Regexp"B= $authserv_id =~ /$search->{"authserv_id"}/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 411 | 2 | ▶ | $match = $match && 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$match && 1
MC/DC0%0/1
$match && 1
$match
Truth table50%1/2
A
A= $match
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 412 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 413 | elsif ( lc $search->{ 'authserv_id' } eq lc $authserv_id ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 414 | 3 | ▶ | $match = $match && 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$match && 1
MC/DC0%0/1
$match && 1
$match
Truth table50%1/2
A
A= $match
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 415 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 416 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 417 | 11 | $match = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 418 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 419 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 420 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 421 | 66 | $match = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 422 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 423 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 424 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 425 | 5 | $match = 0; # uncoverable statement | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 426 | # There are no code paths with the current classes which end up here | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 427 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 428 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 429 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 430 | 1273 | ▶ | if ( exists( $search->{ 'isa' } ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 431 | 447 | ▶ | if ( lc ref $self eq 'mail::authenticationresults::header::' . lc $search->{ 'isa' } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 432 | 134 | ▶ | $match = $match && 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$match && 1
MC/DC100%1/1
$match && 1
$match
Truth table100%2/2
A
A= $match
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 433 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 434 | ▶ | elsif ( lc ref $self eq 'mail::authenticationresults::header' && lc $search->{ 'isa' } eq 'header' ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
lc ref $self eq "mail::authenticationresults::header" and lc $search->{"isa"} eq "header"
MC/DC100%2/2
lc ref $self eq "mail::authenticationresults::header" and lc $search->{"isa"} eq "header"
lc ref $self eq "mail::authenticationresults::header"
lc $search->{"isa"} eq "header"
Truth table100%3/3
A and B
A= lc ref $self eq "mail::authenticationresults::header"B= lc $search->{"isa"} eq "header"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 435 | 5 | ▶ | $match = $match && 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$match && 1
MC/DC100%1/1
$match && 1
$match
Truth table100%2/2
A
A= $match
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 436 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 437 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 438 | 308 | $match = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 439 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 440 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 441 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 442 | 1273 | ▶ | if ( exists( $search->{ 'has' } ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 443 | 33 | foreach my $query ( @{ $search->{ 'has' } } ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 444 | 38 | ▶ | $match = 0 if ( scalar @{ $self->search( $query )->children() } == 0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 445 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 446 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 447 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 448 | 1273 | ▶ | if ( $match ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 449 | 185 | $group->add_child( $self ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 450 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 451 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 452 | 1273 | ▶ | if ( $self->_HAS_CHILDREN() ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 453 | 1031 | foreach my $child ( @{$self->children()} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 454 | 1120 | my $childfound = $child->search( $search ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 455 | 1120 | ▶ | if ( scalar @{ $childfound->children() } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 456 | 214 | $group->add_child( $childfound ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 457 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 458 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 459 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 461 | 1273 | return $group; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 462 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 463 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 464 | 30 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 465 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 466 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||