lib/Mail/Decency/Policy/Core.pm

filter: Statementstmt 47.6% 10 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 22.2% 2 / 9 Podpod 57.1% 4 / 7 totaltotal 43.2% 16 / 37 CC 1 SCAR 5.1
CC
1
Cov
48%
session_data
2.0
add_spam_score
2.0
go_final_state
2.0
CRAP 1.7
« lib/Mail/Decency/Policy/Cookbook.pm ↑ Summary lib/Mail/Decency/Helper/IntervalParse.pm »
1 package Mail::Decency::Policy::Core;
2  
3 8 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 8 extends 'Mail::Decency::Core::Child';
5  
6 8 ▶use version 0.74; our $VERSION = qv( "v0.1.4" );
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 =head1 NAME
9  
10 Mail::Decency::Policy::Core
11  
12 =head1 DESCRIPTION
13  
14 Base class for all policy modules.
15  
16  
17 =head1 CLASS ATTRIBUTES
18  
19 =head2 timeout : Int
20  
21 Timeout for each policy module.
22  
23 Default: 15
24  
25 =cut
26  
27 8 has timeout => ( is => 'rw', isa => 'Int', default => 15 );
28  
29  
30 =head1 METHODS
31  
32 =head2 session_data
33  
34 Access to current session data
35  
36 =cut
37  
38 0 ▶sub session_data {
Subroutine session_data: not called CC=1 SCAR=6.9
Pod documented
39 0 return shift->server->session_data;
40 }
41  
42  
43 =head2 add_spam_score $weight, $details, $reject_message
44  
45 See L<Mail::Decency::Policy>
46  
47 =cut
48  
49 0 ▶sub add_spam_score {
Subroutine add_spam_score: not called CC=1 SCAR=6.9
Pod documented
50 0 my ( $self, @args ) = @_;
51 0 $self->server->add_spam_score( $self, @args );
52 }
53  
54  
55 =head2 go_final_state $state, $messsage
56  
57 See L<Mail::Decency::Policy>
58  
59 =cut
60  
61 0 ▶sub go_final_state {
Subroutine go_final_state: not called CC=1 SCAR=6.9
Pod documented
62 0 my ( $self, @args ) = @_;
63 0 $self->server->go_final_state( $self, @args );
64 }
65  
66  
67 =head2 (del|set|has)_flag
68  
69 See L<Mail::Decency::Policy::SessionItem>
70  
71 =cut
72  
73 0 ▶sub set_flag {
Subroutine set_flag: not called CC=1 SCAR=6.9
Pod undocumented
74 0 my ( $self, $flag ) = @_;
75 0 return $self->session_data->set_flag( $flag );
76 }
77  
78 0 ▶sub has_flag {
Subroutine has_flag: not called CC=1 SCAR=6.9
Pod undocumented
79 0 my ( $self, $flag ) = @_;
80 0 return $self->session_data->has_flag( $flag );
81 }
82  
83 0 ▶sub del_flag {
Subroutine del_flag: not called CC=1 SCAR=6.9
Pod undocumented
84 0 my ( $self, $flag ) = @_;
85 0 return $self->session_data->del_flag( $flag );
86 }
87  
88  
89  
90 =head2 init
91  
92 Should be overwritte by module.
93  
94 =cut
95  
96 0 ▶sub init {}
Subroutine init: not called CC=1 SCAR=0.0
Pod documented
97  
98 =head1 AUTHOR
99  
100 Ulrich Kautz <uk@fortrabbit.de>
101  
102 =head1 COPYRIGHT
103  
104 Copyright (c) 2010 the L</AUTHOR> as listed above
105  
106 =head1 LICENCSE
107  
108 This library is free software and may be distributed under the same terms as perl itself.
109  
110 =cut
111  
112  
113 8 1;
« lib/Mail/Decency/Policy/Cookbook.pm ↑ Summary lib/Mail/Decency/Helper/IntervalParse.pm »