lib/Mail/AuthenticationResults/Token/Assignment.pm

filter: Statementstmt 100% 27 / 27 Branchbran 100% 2 / 2 Conditioncond 100% 6 / 6 MC/DCmcdc 100% 3 / 3 Subroutinesub 100% 6 / 6 Podpod 100% 2 / 2 totaltotal 100% 46 / 46 SCAR 13.9
CC
4
Cov
100%
parse
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 4.0
« lib/Mail/AuthenticationResults/Header/Entry.pm ↑ Summary lib/Mail/AuthenticationResults/Header/SubEntry.pm »
1 package Mail::AuthenticationResults::Token::Assignment;
2 # ABSTRACT: Class for modelling AuthenticationResults Header parts detected as assignments
3  
4 30 require 5.008;
5 30 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 30 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 30 our $VERSION = '2.20230112'; # VERSION
8 30 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 30 ▶use base 'Mail::AuthenticationResults::Token';
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12  
13 sub is {
14 1836 ▶ my ( $self ) = @_;
Subroutine is: called CC=1 SCAR=0.0
Pod documented
15 1836 return 'assignment';
16 }
17  
18 sub parse {
19 359 ▶ my ($self) = @_;
Subroutine parse: called CC=4 SCAR=13.9
Pod documented
20  
21 359 my $header = $self->{ 'header' };
22 359 my $value = q{};
23  
24 359 my $first = substr( $header,0,1 );
25 359 ▶ if ( $first ne '=' && $first ne '.' && $first ne '/' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($first ne "=" and $first ne "." and $first ne "/") 1 358 359
Condition100%6/6
$first ne "=" and $first ne "." and $first ne "/"
!ll&&!rl&&r
35261
$first ne "=" and $first ne "."
!ll&&!rl&&r
268847
MC/DC100%3/3
$first ne "=" and $first ne "." and $first ne "/"
$first ne "=" $first ne "." $first ne "/"
Truth table100%4/4
A and B and C
A= $first ne "="B= $first ne "."C= $first ne "/"
ABCresult
0XX0
10X0
1100
1111
26 1 croak 'not an assignment';
27 }
28  
29 358 $header = substr( $header,1 );
30  
31 358 $self->{ 'value' } = $first;
32 358 $self->{ 'header' } = $header;
33  
34 358 return;
35 }
36  
37 30 1;
38  
39 __END__
« lib/Mail/AuthenticationResults/Header/Entry.pm ↑ Summary lib/Mail/AuthenticationResults/Header/SubEntry.pm »