DKIM/ARC/Seal.pm

filter: Statementstmt 100% 37 / 37 Branchbran 75.0% 12 / 16 Conditioncond 100% 4 / 4 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 8 / 8 Podpod 80.0% 4 / 5 totaltotal 93.0% 67 / 72 CC 11 SCAR 16.8
CC
11
Cov
93%
new
9.1
chain
3.0
BEGIN
1.0
CRAP 5.4
« DKIM/ARC/MessageSignature.pm ↑ Summary DKIM/Canonicalization/nowsp.pm »
1 package Mail::DKIM::ARC::Seal;
2 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 our $VERSION = '1.20261116'; # 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 6 ▶use base 'Mail::DKIM::ARC::MessageSignature';
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15  
16 584 ▶sub new {
Subroutine new: called CC=9 SCAR=22.0
Pod documented
17 584 my $class = shift;
18 584 my %prms = @_;
19 584 my $self = {};
20 584 bless $self, $class;
21  
22 584 ▶ $self->instance( $prms{'Instance'} ) if exists $prms{'Instance'};
Branch: 1 branch
BranchTrueFalseTotal
if exists $prms{"Instance"} 21 563 584
23 584 ▶ $self->algorithm( $prms{'Algorithm'} || 'rsa-sha256' );
Condition100%2/2
$prms{'Algorithm'} || 'rsa-sha256'
l!l
21563
MC/DC100%1/1
$prms{'Algorithm'} || 'rsa-sha256'
$prms{'Algorithm'}
Truth table100%2/2
A
A= $prms{'Algorithm'}
Aresult
11
00
24 584 $self->signature( $prms{'Signature'} );
25 584 ▶ $self->canonicalization( $prms{'Method'} ) if exists $prms{'Method'};
Branch: 1 branch
BranchTrueFalseTotal
if exists $prms{"Method"} 0 584 584
26 584 ▶ $self->chain( $prms{'Chain'} || 'none' );
Condition100%2/2
$prms{'Chain'} || 'none'
l!l
21563
MC/DC100%1/1
$prms{'Chain'} || 'none'
$prms{'Chain'}
Truth table100%2/2
A
A= $prms{'Chain'}
Aresult
11
00
27 584 $self->domain( $prms{'Domain'} );
28 584 $self->selector( $prms{'Selector'} );
29 $self->timestamp(
30 584 ▶ defined $prms{'Timestamp'} ? $prms{'Timestamp'} : time() );
Branch: 1 branch
BranchTrueFalseTotal
defined $prms{'Timestamp'} ? : 16 568 584
31 584 ▶ $self->expiration( $prms{'Expiration'} ) if defined $prms{'Expiration'};
Branch: 1 branch
BranchTrueFalseTotal
if defined $prms{"Expiration"} 0 584 584
32 584 ▶ $self->tags( $prms{'Tags'} ) if defined $prms{'Tags'};
Branch: 1 branch
BranchTrueFalseTotal
if defined $prms{"Tags"} 0 584 584
33 584 ▶ $self->key( $prms{'Key'} ) if defined $prms{'Key'};
Branch: 1 branch
BranchTrueFalseTotal
if defined $prms{"Key"} 21 563 584
34  
35 584 return $self;
36 }
37  
38 135 ▶sub body_hash {
Subroutine body_hash: called CC=1 SCAR=0.0
Pod documented
39  
40 # Not defined for ARC-Seal
41 135 return;
42 }
43  
44 647 ▶sub DEFAULT_PREFIX {
Subroutine DEFAULT_PREFIX: called CC=1 SCAR=0.0
Pod undocumented
45 647 return 'ARC-Seal:';
46 }
47  
48  
49 585 ▶sub chain {
Subroutine chain: called CC=3 SCAR=11.0
Pod documented
50 585 my $self = shift;
51 585 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 584 1 585
52 584 my $cv = shift;
53 die "INVALID chain value $cv"
54 584 ▶ unless grep { $cv eq $_ } qw(none fail pass);
Branch: 1 branch
BranchTrueFalseTotal
unless grep {$cv eq $_;} "none", "fail", "pass" 0 584 584
55 584 $self->set_tag( 'cv', $cv );
56 }
57 585 return $self->get_tag('cv');
58 }
59  
60  
61 541 ▶sub canonicalization {
Subroutine canonicalization: called CC=1 SCAR=0.0
Pod documented
62 541 return ( 'seal', 'seal' );
63 }
64  
65  
66 6 1;
67  
68 __END__
« DKIM/ARC/MessageSignature.pm ↑ Summary DKIM/Canonicalization/nowsp.pm »