DKIM/Canonicalization/nowsp.pm

filter: Statementstmt 51.8% 14 / 27 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 57.1% 4 / 7 Podpod 0.0% 0 / 3 totaltotal 43.9% 18 / 41 CC 3 SCAR 15.9
CC
3
Cov
45%
canonicalize_header
12.0
canonicalize_body
2.0
finish_body
2.0
CRAP 4.9
« DKIM/ARC/Seal.pm ↑ Summary DKIM/Signature.pm »
1 package Mail::DKIM::Canonicalization::nowsp;
2 20 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 20 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 20 our $VERSION = '1.20261116'; # VERSION
5 # ABSTRACT: nowsp canonicalization
6  
7 # Copyright 2005 Messiah College. All rights reserved.
8 # Jason Long <jlong@messiah.edu>
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 20 ▶use base 'Mail::DKIM::Canonicalization::DkimCommon';
Subroutine BEGIN: called CC=1 SCAR=0.0
14 20 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 0 ▶sub canonicalize_header {
Subroutine canonicalize_header: not called CC=3 SCAR=24.8
Pod undocumented
17 0 my $self = shift;
18 0 ▶ croak 'wrong number of parameters' unless ( @_ == 1 );
Branch: 1 branch
BranchTrueFalseTotal
unless @_ == 1 0 0 0
19 0 my ($line) = @_;
20  
21 # remove all whitespace
22 0 $line =~ s/[ \t\015\012]//g;
23  
24 0 ▶ if ( $line =~ /^([^:]+):(.*)$/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($line =~ /^([^:]+):(.*)$/) 0 0 0
25  
26 # lowercase field name
27 0 $line = lc($1) . ":$2";
28 }
29  
30 0 return $line;
31 }
32  
33 0 ▶sub canonicalize_body {
Subroutine canonicalize_body: not called CC=1 SCAR=6.9
Pod undocumented
34 0 my $self = shift;
35 0 my ($multiline) = @_;
36  
37 0 $multiline =~ s/[ \t\015\012]//g;
38 0 return $multiline;
39 }
40  
41 0 ▶sub finish_body {
Subroutine finish_body: not called CC=1 SCAR=6.9
Pod undocumented
42 0 my $self = shift;
43 0 $self->SUPER::finish_body;
44 }
45  
46 20 1;
47  
48 __END__
« DKIM/ARC/Seal.pm ↑ Summary DKIM/Signature.pm »