line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mail::DMARC::Report::Aggregate::Metadata; |
2
|
12
|
|
|
12
|
|
88
|
use strict; |
|
12
|
|
|
|
|
33
|
|
|
12
|
|
|
|
|
411
|
|
3
|
12
|
|
|
12
|
|
81
|
use warnings; |
|
12
|
|
|
|
|
43
|
|
|
12
|
|
|
|
|
602
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.20210927'; |
6
|
|
|
|
|
|
|
|
7
|
12
|
|
|
12
|
|
79
|
use XML::LibXML; |
|
12
|
|
|
|
|
30
|
|
|
12
|
|
|
|
|
143
|
|
8
|
|
|
|
|
|
|
|
9
|
12
|
|
|
12
|
|
2181
|
use parent 'Mail::DMARC::Base'; |
|
12
|
|
|
|
|
33
|
|
|
12
|
|
|
|
|
79
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub org_name { |
12
|
63
|
100
|
|
63
|
0
|
828
|
return $_[0]->{org_name} if 1 == scalar @_; |
13
|
17
|
|
|
|
|
99
|
return $_[0]->{org_name} = $_[1]; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub email { |
17
|
48
|
100
|
|
48
|
0
|
961
|
return $_[0]->{email} if 1 == scalar @_; |
18
|
17
|
|
|
|
|
206
|
return $_[0]->{email} = $_[1]; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub extra_contact_info { |
22
|
30
|
100
|
|
30
|
0
|
760
|
return $_[0]->{extra_contact_info} if 1 == scalar @_; |
23
|
13
|
|
|
|
|
56
|
return $_[0]->{extra_contact_info} = $_[1]; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub report_id { |
27
|
54
|
100
|
|
54
|
0
|
891
|
return $_[0]->{report_id} if 1 == scalar @_; |
28
|
14
|
|
|
|
|
63
|
return $_[0]->{report_id} = $_[1]; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub date_range { |
32
|
2
|
100
|
|
2
|
0
|
600
|
return $_[0]->{date_range} if 1 == scalar @_; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# croak "invalid date_range" if ('HASH' ne ref $_->[1]); |
35
|
1
|
|
|
|
|
6
|
return $_[0]->{date_range} = $_[1]; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub begin { |
39
|
47
|
100
|
|
47
|
0
|
911
|
return $_[0]->{date_range}{begin} if 1 == scalar @_; |
40
|
18
|
|
|
|
|
86
|
return $_[0]->{date_range}{begin} = $_[1]; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub end { |
44
|
47
|
100
|
|
47
|
0
|
872
|
return $_[0]->{date_range}{end} if 1 == scalar @_; |
45
|
18
|
|
|
|
|
82
|
return $_[0]->{date_range}{end} = $_[1]; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub error { |
49
|
11
|
100
|
|
11
|
0
|
1705
|
return $_[0]->{error} if 1 == scalar @_; |
50
|
3
|
|
|
|
|
4
|
return push @{ $_[0]->{error} }, $_[1]; |
|
3
|
|
|
|
|
16
|
|
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub uuid { |
54
|
18
|
100
|
|
18
|
0
|
709
|
return $_[0]->{uuid} if 1 == scalar @_; |
55
|
3
|
|
|
|
|
14
|
return $_[0]->{uuid} = $_[1]; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub as_xml { |
59
|
7
|
|
|
7
|
0
|
603
|
my $self = shift; |
60
|
7
|
|
|
|
|
24
|
my $meta = "\t\n"; |
61
|
|
|
|
|
|
|
|
62
|
7
|
|
|
|
|
18
|
foreach my $f (qw/ org_name email extra_contact_info report_id /) { |
63
|
28
|
50
|
|
|
|
85
|
my $val = $self->$f or next; |
64
|
28
|
|
|
|
|
478
|
$val = XML::LibXML::Text->new( $val )->toString(); |
65
|
28
|
|
|
|
|
192
|
$meta .= "\t\t<$f>$val$f>\n"; |
66
|
|
|
|
|
|
|
} |
67
|
7
|
|
|
|
|
24
|
my $begin = XML::LibXML::Text->new( $self->begin )->toString(); |
68
|
7
|
|
|
|
|
36
|
my $end = XML::LibXML::Text->new( $self->end )->toString(); |
69
|
7
|
|
|
|
|
46
|
$meta .= "\t\t\n\t\t\t" . $begin . "\n" |
70
|
|
|
|
|
|
|
. "\t\t\t" . $end . "\n\t\t\n"; |
71
|
|
|
|
|
|
|
|
72
|
7
|
|
|
|
|
26
|
my $errors = $self->error; |
73
|
7
|
100
|
66
|
|
|
34
|
if ( $errors && @$errors ) { |
74
|
3
|
|
|
|
|
8
|
foreach my $err ( @$errors ) { |
75
|
4
|
|
|
|
|
37
|
$err = XML::LibXML::Text->new( $err )->toString(); |
76
|
4
|
|
|
|
|
22
|
$meta .= "\t\t$err\n"; |
77
|
|
|
|
|
|
|
}; |
78
|
|
|
|
|
|
|
}; |
79
|
7
|
|
|
|
|
24
|
$meta .= "\t"; |
80
|
7
|
|
|
|
|
35
|
return $meta; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
1; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
__END__ |