| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Net::Defensio::Response; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
|
4
|
6
|
|
|
6
|
|
36
|
use base qw( Class::Accessor::Fast ); |
|
|
6
|
|
|
|
|
10
|
|
|
|
6
|
|
|
|
|
6438
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw( |
|
7
|
|
|
|
|
|
|
action |
|
8
|
|
|
|
|
|
|
status message api_version |
|
9
|
|
|
|
|
|
|
spam spaminess signature |
|
10
|
|
|
|
|
|
|
ham false_positives false_negatives accuracy |
|
11
|
|
|
|
|
|
|
learning learning_message |
|
12
|
|
|
|
|
|
|
)); |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub success { |
|
15
|
4
|
|
|
4
|
1
|
460
|
my $r = shift; |
|
16
|
4
|
|
50
|
|
|
25
|
return ($r->status || '') eq 'success'; |
|
17
|
|
|
|
|
|
|
} |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub is_spam { |
|
20
|
1
|
|
|
1
|
1
|
2
|
my $r = shift; |
|
21
|
1
|
50
|
|
|
|
5
|
return undef unless defined $r->spam; |
|
22
|
1
|
50
|
|
|
|
12
|
$r->spam eq 'true' ? 1 : 0; |
|
23
|
|
|
|
|
|
|
} |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub is_ham { |
|
26
|
1
|
|
|
1
|
1
|
3
|
my $r = shift; |
|
27
|
1
|
50
|
|
|
|
6
|
return undef unless defined $r->spam; |
|
28
|
1
|
50
|
|
|
|
10
|
$r->spam eq 'false' ? 1 : 0; |
|
29
|
|
|
|
|
|
|
} |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
|
32
|
|
|
|
|
|
|
__END__ |