Silly/Rot13.pm

filter: Statementstmt 33.3% 9 / 27 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 3 / 6 Podpod 0.0% 0 / 4 totaltotal 32.4% 12 / 37 CC 1 SCAR 4.1
CC
1
Cov
33%
Cobalt_register
2.0
Cobalt_unregister
2.0
Bot_public_cmd_rot13
2.0
CRAP 1.5
« Silly/OutputLeet.pm ↑ Summary Silly/Reverse.pm »
1 package Bot::Cobalt::Plugin::Silly::Rot13;
2 1 $Bot::Cobalt::Plugin::Silly::Rot13::VERSION = '0.030001';
3 1 ▶use strictures 2;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use Object::Pluggable::Constants qw/ :ALL /;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶sub new { bless [], shift }
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
8  
9 sub Cobalt_register {
10 0 ▶ my ($self, $core) = splice @_, 0, 2;
Subroutine Cobalt_register: not called CC=1 SCAR=6.9
Pod undocumented
11
12 0 $core->plugin_register( $self, 'SERVER',
13 'public_cmd_rot13'
14 );
15
16 0 $core->log->info("Loaded");
17  
18 0 return PLUGIN_EAT_NONE
19 }
20  
21 sub Cobalt_unregister {
22 0 ▶ my ($self, $core) = splice @_, 0, 2;
Subroutine Cobalt_unregister: not called CC=1 SCAR=6.9
Pod undocumented
23  
24 0 $core->log->info("Unloaded");
25  
26 0 return PLUGIN_EAT_NONE
27 }
28  
29 sub Bot_public_cmd_rot13 {
30 0 ▶ my ($self, $core) = splice @_, 0, 2;
Subroutine Bot_public_cmd_rot13: not called CC=1 SCAR=6.9
Pod undocumented
31  
32 0 my $msg = ${ $_[0] };
33 0 my $context = $msg->context;
34  
35 0 my @message = @{ $msg->message_array };
36 0 my $str = join ' ', @message;
37  
38 0 $str =~ tr/a-zA-Z/n-za-mN-ZA-M/;
39  
40 0 my $channel = $msg->channel;
41  
42 0 $core->send_event( 'send_message',
43 $context,
44 $channel,
45 "rot13: ".$str
46 );
47
48 0 return PLUGIN_EAT_ALL
49 }
50  
51 1 1;
52 __END__
« Silly/OutputLeet.pm ↑ Summary Silly/Reverse.pm »