DJabberd/Plugin.pm

filter: Statementstmt 80.0% 16 / 20 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 57.1% 4 / 7 Podpod 0.0% 0 / 5 totaltotal 66.6% 24 / 36 CC 3 SCAR 6.9
CC
3
Cov
83%
new
3.0
run_after
2.0
run_before
2.0
CRAP 2.0
« DJabberd/SASL/ManagerBase.pm ↑ Summary DJabberd/RosterStorage.pm »
1 package DJabberd::Plugin;
2 20 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 20 ▶use DJabberd::Log;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 20 our $logger = DJabberd::Log->get_logger();
5  
6 210 ▶sub new {
Subroutine new: called CC=3 SCAR=11.0
Pod undocumented
7 210 my ($class, @config) = @_;
8 210 my $self = bless {}, $class;
9  
10 210 ▶ if (@config) {
Branch: 1 branch
BranchTrueFalseTotal
if (@config) 82 128 210
11 82 ▶ while (my ($k, $v) = splice(@config, 0, 2)) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = splice(@config, 0, 2)) 123 82 205
12 123 my $meth = "set_config_$k";
13 123 $self->$meth($v);
14 }
15 82 $self->finalize;
16 }
17  
18 210 return $self;
19 }
20  
21 # called when </Plugin> line is parsed. you can die here if the object hasn't
22 # been setup properly
23 41 ▶sub finalize {
Subroutine finalize: called CC=1 SCAR=0.0
Pod undocumented
24 }
25  
26 # list of classnames you want to run before/after (in your phase only)
27 0 ▶sub run_after {
Subroutine run_after: not called CC=1 SCAR=6.9
Pod undocumented
28 return ()
29 0 }
30  
31 0 ▶sub run_before {
Subroutine run_before: not called CC=1 SCAR=6.9
Pod undocumented
32 return ()
33 0 }
34  
35 0 ▶sub register {
Subroutine register: not called CC=1 SCAR=6.9
Pod undocumented
36 0 my ($self, $server) = @_;
37 0 $logger->warn("[not implemented] $self should register for $server");
38 }
39  
40 20 1;
« DJabberd/SASL/ManagerBase.pm ↑ Summary DJabberd/RosterStorage.pm »