DKIM/ARC/Seal.pm

filter: Statementstmt 100% 37 / 37 Branchbran 68.7% 11 / 16 Conditioncond 100% 4 / 4 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 8 / 8 Podpod 80.0% 4 / 5 totaltotal 91.6% 66 / 72 CC 11 SCAR 16.8
CC
11
Cov
91%
new
9.1
chain
3.1
BEGIN
1.0
CRAP 5.4
« DKIM/ARC/MessageSignature.pm ↑ Summary DKIM/Canonicalization/nowsp.pm »
1 package Mail::DKIM::ARC::Seal;
2 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 our $VERSION = '1.20240923'; # VERSION
5 # ABSTRACT: represents a ARC-Seal header
6  
7 # Copyright 2017 FastMail Pty Ltd. All Rights Reserved.
8 # Bron Gondwana <brong@fastmailteam.com>
9 #
10 # This program is free software; you can redistribute it and/or
11 # modify it under the same terms as Perl itself.
12  
13 3 ▶use base 'Mail::DKIM::ARC::MessageSignature';
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15  
16 385 ▶sub new {
Subroutine new: called CC=9 SCAR=22.0
Pod documented
17 385 my $class = shift;
18 385 my %prms = @_;
19 385 my $self = {};
20 385 bless $self, $class;
21  
22 385 ▶ $self->instance( $prms{'Instance'} ) if exists $prms{'Instance'};
Branch: 1 branch
BranchTrueFalseTotal
if exists $prms{"Instance"} 19 366 385
23 385 ▶ $self->algorithm( $prms{'Algorithm'} || 'rsa-sha256' );
Condition100%2/2
$prms{'Algorithm'} || 'rsa-sha256'
l!l
19366
MC/DC100%1/1
$prms{'Algorithm'} || 'rsa-sha256'
$prms{'Algorithm'}
Truth table100%2/2
A
A= $prms{'Algorithm'}
Aresult
11
00
24 385 $self->signature( $prms{'Signature'} );
25 385 ▶ $self->canonicalization( $prms{'Method'} ) if exists $prms{'Method'};
Branch: 1 branch
BranchTrueFalseTotal
if exists $prms{"Method"} 0 385 385
26 385 ▶ $self->chain( $prms{'Chain'} || 'none' );
Condition100%2/2
$prms{'Chain'} || 'none'
l!l
19366
MC/DC100%1/1
$prms{'Chain'} || 'none'
$prms{'Chain'}
Truth table100%2/2
A
A= $prms{'Chain'}
Aresult
11
00
27 385 $self->domain( $prms{'Domain'} );
28 385 $self->selector( $prms{'Selector'} );
29 $self->timestamp(
30 385 ▶ defined $prms{'Timestamp'} ? $prms{'Timestamp'} : time() );
Branch: 1 branch
BranchTrueFalseTotal
defined $prms{'Timestamp'} ? : 16 369 385
31 385 ▶ $self->expiration( $prms{'Expiration'} ) if defined $prms{'Expiration'};
Branch: 1 branch
BranchTrueFalseTotal
if defined $prms{"Expiration"} 0 385 385
32 385 ▶ $self->tags( $prms{'Tags'} ) if defined $prms{'Tags'};
Branch: 1 branch
BranchTrueFalseTotal
if defined $prms{"Tags"} 0 385 385
33 385 ▶ $self->key( $prms{'Key'} ) if defined $prms{'Key'};
Branch: 1 branch
BranchTrueFalseTotal
if defined $prms{"Key"} 19 366 385
34  
35 385 return $self;
36 }
37  
38 131 ▶sub body_hash {
Subroutine body_hash: called CC=1 SCAR=0.0
Pod documented
39  
40 # Not defined for ARC-Seal
41 131 return;
42 }
43  
44 442 ▶sub DEFAULT_PREFIX {
Subroutine DEFAULT_PREFIX: called CC=1 SCAR=0.0
Pod undocumented
45 442 return 'ARC-Seal:';
46 }
47  
48  
49 385 ▶sub chain {
Subroutine chain: called CC=3 SCAR=11.2
Pod documented
50 385 my $self = shift;
51 385 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 385 0 385
52 385 my $cv = shift;
53 die "INVALID chain value $cv"
54 385 ▶ unless grep { $cv eq $_ } qw(none fail pass);
Branch: 1 branch
BranchTrueFalseTotal
unless grep {$cv eq $_;} "none", "fail", "pass" 0 385 385
55 385 $self->set_tag( 'cv', $cv );
56 }
57 385 return $self->get_tag('cv');
58 }
59  
60  
61 382 ▶sub canonicalization {
Subroutine canonicalization: called CC=1 SCAR=0.0
Pod documented
62 382 return ( 'seal', 'seal' );
63 }
64  
65  
66 3 1;
67  
68 __END__
« DKIM/ARC/MessageSignature.pm ↑ Summary DKIM/Canonicalization/nowsp.pm »