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