Karmasphere/Parser/RBL/Mixed.pm

filter: Statementstmt 88.4% 23 / 26 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 2 totaltotal 82.0% 32 / 39 CC 3 SCAR 5.9
CC
3
Cov
87%
tweaks
3.1
my_format
2.0
BEGIN
1.0
CRAP 1.8
« Karmasphere/Parser/Score/Base.pm ↑ Summary Karmasphere/Parser/RBL/Domain.pm »
1 package Mail::Karmasphere::Parser::RBL::Mixed;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use base 'Mail::Karmasphere::Parser::RBL::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Mail::Karmasphere::Parser::Record;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶sub _streams { qw(ip4 domain) }
Subroutine _streams: called CC=1 SCAR=0.0
9  
10 0 ▶sub my_format { "rbl.mixed" } # if the source table's "magic" field is rbl.mixed, this module deals with it.
Subroutine my_format: not called CC=1 SCAR=6.9
Pod undocumented
11  
12 12 ▶sub tweaks {
Subroutine tweaks: called CC=3 SCAR=11.2
Pod undocumented
13 12 my $self = shift;
14 12 my $identity = shift;
15 # if it's a domain identity, we output to the domain stream.
16 # if it's an ip4 identity, we output to the ip4 stream.
17 12 my $type = Mail::Karmasphere::Parser::Record::guess_identity_type($identity);
18 12 my $stream;
19 12 ▶ if ($type eq "ip4") {
Branch: 2 branches
BranchTrueFalseTotal
if ($type eq 'ip4') { } 6 6 12
elsif ($type eq 'domain') { } 6 0 6
20 6 $stream = 0;
21 # in an rbl.mixed input file, we'll find things like "4.3.2.1".
22 # we want to return "1.2.3.4".
23 6 $identity = join ".", reverse split /\./, $identity;
24 }
25 elsif ($type eq "domain") {
26 6 $stream = 1;
27 }
28 else {
29 0 $self->warning("guessed type=$type for identity=$identity, skipping.");
30 0 return;
31 }
32  
33 12 return ($type, $stream, $identity);
34 }
35  
36  
37 2 1;
« Karmasphere/Parser/Score/Base.pm ↑ Summary Karmasphere/Parser/RBL/Domain.pm »