blib/lib/Bot/Cobalt/Conf/File/Channels.pm

filter: Statementstmt 100% 25 / 25 Branchbran 50.0% 3 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 92.1% 35 / 38 CC 5 SCAR 8.9
CC
5
Cov
90%
__ANON__
4.1
context
2.0
BEGIN
1.0
CRAP 2.4
« blib/lib/Bot/Cobalt/Conf/File/PerPlugin.pm ↑ Summary blib/lib/Bot/Cobalt/Plugin/OutputFilters/StripColor.pm »
1 package Bot::Cobalt::Conf::File::Channels;
2 2 $Bot::Cobalt::Conf::File::Channels::VERSION = '0.021003';
3 2 ▶use strictures 2;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use Bot::Cobalt::Common ':types';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8  
9 2 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 extends 'Bot::Cobalt::Conf::File';
11  
12  
13 2 ▶sub context {
Subroutine context: called CC=2 SCAR=7.1
Pod documented
14 2 my ($self, $context) = @_;
15 2 ▶ croak "context() requires a server context identifier"
Branch: 1 branch
BranchTrueFalseTotal
unless defined $context 0 2 2
16 unless defined $context;
17  
18 2 $self->cfg_as_hash->{$context}
19 }
20  
21  
22 2 ▶around 'validate' => sub {
Subroutine __ANON__: called CC=4 SCAR=14.1
23 2 my ($orig, $self, $cfg) = @_;
24  
25 2 my @contexts = keys %$cfg;
26 2 ▶ die "There are no contexts defined.\n" unless @contexts;
Branch: 1 branch
BranchTrueFalseTotal
unless @contexts 0 2 2
27
28 2 for my $context (@contexts) {
29 die "Context directive $context is not a hash"
30 2 ▶ unless ref $cfg->{$context} eq 'HASH';
Branch: 1 branch
BranchTrueFalseTotal
unless ref $cfg->{$context} eq "HASH" 0 2 2
31 }
32  
33 1
34 2 };
35  
36  
37 2 1;
38 __END__
« blib/lib/Bot/Cobalt/Conf/File/PerPlugin.pm ↑ Summary blib/lib/Bot/Cobalt/Plugin/OutputFilters/StripColor.pm »