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/Connection/AuthenSASL.pm ↑ Summary DJabberd/RosterStorage.pm »
1 package DJabberd::Plugin;
2 17 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 17 ▶use DJabberd::Log;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 17 our $logger = DJabberd::Log->get_logger();
5  
6 sub new {
7 185 ▶ my ($class, @config) = @_;
Subroutine new: called CC=3 SCAR=11.0
Pod undocumented
8 185 my $self = bless {}, $class;
9  
10 185 ▶ if (@config) {
Branch: 1 branch
BranchTrueFalseTotal
if (@config) 72 113 185
11 72 ▶ while (my ($k, $v) = splice(@config, 0, 2)) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = splice(@config, 0, 2)) 108 72 180
12 108 my $meth = "set_config_$k";
13 108 $self->$meth($v);
14 }
15 72 $self->finalize;
16 }
17  
18 185 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 ▶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 sub run_after {
28 return ()
29 0 ▶}
Subroutine run_after: not called CC=1 SCAR=6.9
Pod undocumented
30  
31 sub run_before {
32 return ()
33 0 ▶}
Subroutine run_before: not called CC=1 SCAR=6.9
Pod undocumented
34  
35 sub register {
36 0 ▶ my ($self, $server) = @_;
Subroutine register: not called CC=1 SCAR=6.9
Pod undocumented
37 0 $logger->warn("[not implemented] $self should register for $server");
38 }
39  
40 17 1;
« DJabberd/SASL/Connection/AuthenSASL.pm ↑ Summary DJabberd/RosterStorage.pm »