blib/lib/Bot/Cobalt/Plugin/OutputFilters/StripColor.pm

filter: Statementstmt 36.3% 12 / 33 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 44.4% 4 / 9 Podpod 0.0% 0 / 6 totaltotal 32.0% 16 / 50 CC 2 SCAR 8.8
CC
2
Cov
34%
Outgoing_ctcp
6.0
Cobalt_register
2.0
Cobalt_unregister
2.0
CRAP 2.4
« blib/lib/Bot/Cobalt/Conf/File/Channels.pm ↑ Summary blib/lib/Bot/Cobalt/Core/Sugar.pm »
1 package Bot::Cobalt::Plugin::OutputFilters::StripColor;
2 1 $Bot::Cobalt::Plugin::OutputFilters::StripColor::VERSION = '0.021003';
3  
4  
5 1 ▶use strictures 2;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use Object::Pluggable::Constants qw/ :ALL /;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 ▶use IRC::Utils qw/ strip_color /;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 ▶sub new { bless [], shift }
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
12  
13 0 ▶sub Cobalt_register {
Subroutine Cobalt_register: not called CC=1 SCAR=6.9
Pod undocumented
14 0 my ($self, $core) = splice @_, 0, 2;
15  
16 0 $core->plugin_register( $self, 'USER',
17 'message', 'notice', 'ctcp',
18 );
19  
20 0 $core->log->info("Registered, filtering COLORS");
21  
22 0 return PLUGIN_EAT_NONE
23 }
24  
25 0 ▶sub Cobalt_unregister {
Subroutine Cobalt_unregister: not called CC=1 SCAR=6.9
Pod undocumented
26 0 my ($self, $core) = splice @_, 0, 2;
27  
28 0 $core->log->info("Unregistered");
29  
30 0 return PLUGIN_EAT_NONE
31 }
32  
33 0 ▶sub Outgoing_message {
Subroutine Outgoing_message: not called CC=1 SCAR=6.9
Pod undocumented
34 0 my ($self, $core) = splice @_, 0, 2;
35  
36 0 ${$_[2]} = strip_color(${$_[2]});
37  
38 0 return PLUGIN_EAT_NONE
39 }
40  
41 0 ▶sub Outgoing_notice { Outgoing_message(@_) }
Subroutine Outgoing_notice: not called CC=1 SCAR=6.9
Pod undocumented
42  
43 0 ▶sub Outgoing_ctcp {
Subroutine Outgoing_ctcp: not called CC=2 SCAR=17.9
Pod undocumented
44 0 my ($self, $core) = splice @_, 0, 2;
45 0 my $type = ${$_[1]};
46  
47 0 ▶ return PLUGIN_EAT_NONE unless uc($type) eq 'ACTION';
Branch: 1 branch
BranchTrueFalseTotal
unless uc $type eq "ACTION" 0 0 0
48  
49 0 ${$_[3]} = strip_color(${$_[3]});
50  
51 0 return PLUGIN_EAT_NONE
52 }
53  
54 1 1;
55 __END__
« blib/lib/Bot/Cobalt/Conf/File/Channels.pm ↑ Summary blib/lib/Bot/Cobalt/Core/Sugar.pm »