Message/Field/DKIM.pm

filter: Statementstmt 91.8% 45 / 49 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 88.0% 22 / 25 Podpod 95.0% 19 / 20 totaltotal 90.6% 87 / 96 CC 3 SCAR 2.9
CC
3
Cov
90%
parse
3.0
produceBody
2.0
addAttribute
2.0
CRAP 1.3
« Message/TransferEnc/QuotedPrint.pm ↑ Summary Message/Convert.pm »
1 # This code is part of Perl distribution Mail-Message version 4.05.
2 # The POD got stripped from this file by OODoc version 3.06.
3 # For contributors see file ChangeLog.
4  
5 # This software is copyright (c) 2001-2026 by Mark Overmeer.
6  
7 # This is free software; you can redistribute it and/or modify it under
8 # the same terms as the Perl 5 programming language system itself.
9 # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later
10  
11  
12 package Mail::Message::Field::DKIM;{
13 28 our $VERSION = '4.05';
14 }
15  
16 28 ▶use parent 'Mail::Message::Field::Structured';
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 28 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 28 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 28 ▶use Log::Report 'mail-message', import => [ qw/__x error/ ];
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 28 ▶use URI ();
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 #--------------------
26  
27 sub init($)
28 1 ▶{ my ($self, $args) = @_;
Subroutine init: called CC=1 SCAR=0.0
Pod undocumented
29 1 $self->{MMFD_tags} = +{ v => 1, a => 'rsa-sha256' };
30 1 $self->SUPER::init($args);
31 }
32  
33 sub parse($)
34 1 ▶{ my ($self, $string) = @_;
Subroutine parse: called CC=3 SCAR=11.0
Pod documented
35 1 my $tags = $self->{MMFD_tags};
36  
37 1 foreach (split /\;/, $string)
38 13 ▶ { m/^\s*([a-z][a-z0-9_]*)\s*\=\s*([\s\x21-\x7E]+?)\s*$/is or next;
Branch: 1 branch
BranchTrueFalseTotal
/^\s*([a-z][a-z0-9_]*)\s*\=\s*([\s\x21-\x7E]+?)\s*$/is or next 13 0 13
39 # tag-values stay unparsed (for now)
40 13 $self->addTag($1, $2);
41 }
42  
43 1 (undef, $string) = $self->consumeComment($string);
44 1 $self;
45 }
46  
47 sub produceBody()
48 0 ▶{ my $self = shift;
Subroutine produceBody: not called CC=1 SCAR=6.9
Pod documented
49 }
50  
51 #--------------------
52  
53  
54 sub addAttribute($;@)
55 0 ▶{ my $self = shift;
Subroutine addAttribute: not called CC=1 SCAR=6.9
Pod documented
56 0 error __x"no attributes for DKIM headers.";
57 }
58  
59  
60 sub addTag($$)
61 13 ▶{ my ($self, $name) = (shift, lc shift);
Subroutine addTag: called CC=1 SCAR=0.0
Pod documented
62 13 $self->{MMFD_tags}{$name} = join ' ', @_;
63 13 $self;
64 }
65  
66  
67 13 ▶sub tag($) { $_[0]->{MMFD_tags}{lc $_[1]} }
Subroutine tag: called CC=1 SCAR=0.0
Pod documented
68  
69 #--------------------
70  
71 1 ▶sub tagAlgorithm() { $_[0]->tag('a') }
Subroutine tagAlgorithm: called CC=1 SCAR=0.0
Pod documented
72 1 ▶sub tagSignData() { $_[0]->tag('b') }
Subroutine tagSignData: called CC=1 SCAR=0.0
Pod documented
73 1 ▶sub tagSignature() { $_[0]->tag('bh') }
Subroutine tagSignature: called CC=1 SCAR=0.0
Pod documented
74 1 ▶sub tagC14N() { $_[0]->tag('c') }
Subroutine tagC14N: called CC=1 SCAR=0.0
Pod documented
75 1 ▶sub tagDomain() { $_[0]->tag('d') }
Subroutine tagDomain: called CC=1 SCAR=0.0
Pod documented
76 1 ▶sub tagSignedHeaders() { $_[0]->tag('h') }
Subroutine tagSignedHeaders: called CC=1 SCAR=0.0
Pod documented
77 1 ▶sub tagAgentID() { $_[0]->tag('i') }
Subroutine tagAgentID: called CC=1 SCAR=0.0
Pod documented
78 0 ▶sub tagBodyLength(){ $_[0]->tag('l') }
Subroutine tagBodyLength: not called CC=1 SCAR=6.9
Pod documented
79 1 ▶sub tagQueryMethods() { $_[0]->tag('q') }
Subroutine tagQueryMethods: called CC=1 SCAR=0.0
Pod documented
80 1 ▶sub tagSelector() { $_[0]->tag('s') }
Subroutine tagSelector: called CC=1 SCAR=0.0
Pod documented
81 1 ▶sub tagTimestamp() { $_[0]->tag('t') }
Subroutine tagTimestamp: called CC=1 SCAR=0.0
Pod documented
82 1 ▶sub tagExpires() { $_[0]->tag('x') }
Subroutine tagExpires: called CC=1 SCAR=0.0
Pod documented
83 1 ▶sub tagVersion() { $_[0]->tag('v') }
Subroutine tagVersion: called CC=1 SCAR=0.0
Pod documented
84 1 ▶sub tagExtract() { $_[0]->tag('z') }
Subroutine tagExtract: called CC=1 SCAR=0.0
Pod documented
85  
86 #--------------------
87  
88 28 1;
« Message/TransferEnc/QuotedPrint.pm ↑ Summary Message/Convert.pm »