Message/Field/DKIM.pm

filter: Statementstmt 89.8% 44 / 49 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 88.0% 22 / 25 Podpod 95.0% 19 / 20 totaltotal 89.5% 86 / 96 CC 3 SCAR 2.9
CC
3
Cov
88%
parse
3.0
produceBody
2.0
addAttribute
2.0
CRAP 1.3
« Message/TransferEnc/QuotedPrint.pm ↑ Summary Message/Convert.pm »
1 # Copyrights 2001-2022 by [Mark Overmeer <markov@cpan.org>].
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.03.
5 # This code is part of distribution Mail-Message. 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::Message::Field::DKIM;
10 23 ▶use vars '$VERSION';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 23 $VERSION = '3.012';
12  
13 23 ▶use base 'Mail::Message::Field::Structured';
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 23 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 23 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 23 ▶use URI;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20  
21 sub init($)
22 1 ▶{ my ($self, $args) = @_;
Subroutine init: called CC=1 SCAR=0.0
Pod undocumented
23 1 $self->{MMFD_tags} = { v => 1, a => 'rsa-sha256' };
24 1 $self->SUPER::init($args);
25 }
26  
27 sub parse($)
28 1 ▶{ my ($self, $string) = @_;
Subroutine parse: called CC=3 SCAR=11.0
Pod documented
29  
30 1 my $tags = $self->{MMFD_tags};
31  
32 1 foreach (split /\;/, $string)
33 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 0 13 13
34 # tag-values stay unparsed (for now)
35 13 $self->addTag($1, $2);
36 }
37  
38 1 (undef, $string) = $self->consumeComment($string);
39  
40 1 $self;
41 }
42  
43 sub produceBody()
44 0 ▶{ my $self = shift;
Subroutine produceBody: not called CC=1 SCAR=6.9
Pod documented
45 }
46  
47 #------------------------------------------
48  
49  
50  
51 sub addAttribute($;@)
52 0 ▶{ my $self = shift;
Subroutine addAttribute: not called CC=1 SCAR=6.9
Pod documented
53 0 $self->log(ERROR => 'No attributes for DKIM headers.');
54 0 $self;
55 }
56  
57  
58 sub addTag($$)
59 13 ▶{ my ($self, $name) = (shift, lc shift);
Subroutine addTag: called CC=1 SCAR=0.0
Pod documented
60 13 $self->{MMFD_tags}{$name} = join ' ', @_;
61 13 $self;
62 }
63  
64  
65 13 ▶sub tag($) { $_[0]->{MMFD_tags}{lc $_[1]} }
Subroutine tag: called CC=1 SCAR=0.0
Pod documented
66  
67  
68 #------------------------------------------
69  
70 1 ▶sub tagAlgorithm() { shift->tag('a') }
Subroutine tagAlgorithm: called CC=1 SCAR=0.0
Pod documented
71 1 ▶sub tagSignData() { shift->tag('b') }
Subroutine tagSignData: called CC=1 SCAR=0.0
Pod documented
72 1 ▶sub tagSignature() { shift->tag('bh') }
Subroutine tagSignature: called CC=1 SCAR=0.0
Pod documented
73 1 ▶sub tagC14N() { shift->tag('c') }
Subroutine tagC14N: called CC=1 SCAR=0.0
Pod documented
74 1 ▶sub tagDomain() { shift->tag('d') }
Subroutine tagDomain: called CC=1 SCAR=0.0
Pod documented
75 1 ▶sub tagSignedHeaders() { shift->tag('h') }
Subroutine tagSignedHeaders: called CC=1 SCAR=0.0
Pod documented
76 1 ▶sub tagAgentID() { shift->tag('i') }
Subroutine tagAgentID: called CC=1 SCAR=0.0
Pod documented
77 0 ▶sub tagBodyLength(){ shift->tag('l') }
Subroutine tagBodyLength: not called CC=1 SCAR=6.9
Pod documented
78 1 ▶sub tagQueryMethods() { shift->tag('q') }
Subroutine tagQueryMethods: called CC=1 SCAR=0.0
Pod documented
79 1 ▶sub tagSelector() { shift->tag('s') }
Subroutine tagSelector: called CC=1 SCAR=0.0
Pod documented
80 1 ▶sub tagTimestamp() { shift->tag('t') }
Subroutine tagTimestamp: called CC=1 SCAR=0.0
Pod documented
81 1 ▶sub tagExpires() { shift->tag('x') }
Subroutine tagExpires: called CC=1 SCAR=0.0
Pod documented
82 1 ▶sub tagVersion() { shift->tag('v') }
Subroutine tagVersion: called CC=1 SCAR=0.0
Pod documented
83 1 ▶sub tagExtract() { shift->tag('z') }
Subroutine tagExtract: called CC=1 SCAR=0.0
Pod documented
84  
85 #------------------------------------------
86  
87  
88 23 1;
« Message/TransferEnc/QuotedPrint.pm ↑ Summary Message/Convert.pm »