MtPolicyd/Plugin/Result.pm

filter: Statementstmt 80.9% 17 / 21 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 3 totaltotal 70.9% 22 / 31 CC 2 SCAR 4.4
CC
2
Cov
78%
new_header_once
2.1
new_dunno
2.0
BEGIN
1.0
CRAP 1.5
« MtPolicyd/Plugin.pm ↑ Summary MtPolicyd/Connection.pm »
1 package Mail::MtPolicyd::Plugin::Result;
2  
3 21 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 21 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 21 our $VERSION = '2.01'; # VERSION
7 # ABSTRACT: result returned by a plugin
8  
9 21 has 'action' => ( is => 'rw', isa => 'Maybe[Str]' );
10 21 has 'abort' => ( is => 'rw', isa => 'Bool', default => 0 );
11  
12 sub new_dunno {
13 0 ▶ my $class = shift;
Subroutine new_dunno: not called CC=1 SCAR=6.9
Pod undocumented
14
15 0 my $obj = $class->new(
16 action => 'dunno',
17 abort => 1,
18 );
19 0 return($obj);
20 }
21  
22 sub new_header {
23 1 ▶ my ( $class, $header, $value ) = @_;
Subroutine new_header: called CC=1 SCAR=0.0
Pod undocumented
24
25 1 my $obj = $class->new(
26 action => 'PREPEND '.$header.': '.$value,
27 abort => 1,
28 );
29 1 return($obj);
30 }
31  
32 sub new_header_once {
33 1 ▶ my ( $class, $is_done, $header, $value ) = @_;
Subroutine new_header_once: called CC=2 SCAR=7.6
Pod undocumented
34  
35 1 ▶ if( $is_done ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($is_done) 0 1 1
36 0 return $class->new_dunno;
37 }
38 1 return $class->new_header($header, $value);
39 }
40  
41 21 __PACKAGE__->meta->make_immutable;
42  
43 21 1;
44  
45 __END__
46  
47 =pod
48  
49 =encoding UTF-8
50  
51 =head1 NAME
52  
53 Mail::MtPolicyd::Plugin::Result - result returned by a plugin
54  
55 =head1 VERSION
56  
57 version 2.01
58  
59 =head1 AUTHOR
60  
61 Markus Benning <ich@markusbenning.de>
62  
63 =head1 COPYRIGHT AND LICENSE
64  
65 This software is Copyright (c) 2014 by Markus Benning <ich@markusbenning.de>.
66  
67 This is free software, licensed under:
68  
69 The GNU General Public License, Version 2, June 1991
70  
71 =cut
« MtPolicyd/Plugin.pm ↑ Summary MtPolicyd/Connection.pm »