Silly/DailyFail.pm

filter: Statementstmt 42.8% 12 / 28 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 4 / 8 Podpod 0.0% 0 / 5 totaltotal 37.2% 16 / 43 SCAR 10.5
CC
2
Cov
40%
Bot_public_cmd_headline
6.0
Cobalt_register
2.0
Cobalt_unregister
2.0
CRAP 2.9
« Silly/LOLCAT.pm ↑ Summary Silly/BoneEasy.pm »
1 package Bot::Cobalt::Plugin::Silly::DailyFail;
2 1 $Bot::Cobalt::Plugin::Silly::DailyFail::VERSION = '0.031001';
3 1 ▶use strictures 2;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use Acme::Daily::Fail 'get_headline';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use Bot::Cobalt::Common;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 ▶sub new { bless [], shift }
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
10  
11 sub Cobalt_register {
12 0 ▶ my ($self, $core) = splice @_, 0, 2;
Subroutine Cobalt_register: not called CC=1 SCAR=6.9
Pod undocumented
13
14 0 $core->plugin_register( $self, 'SERVER',
15 'public_cmd_headline', 'public_cmd_dailyfail'
16 );
17
18 0 $core->log->info("Loaded");
19  
20 0 return PLUGIN_EAT_NONE
21 }
22  
23 sub Cobalt_unregister {
24 0 ▶ my ($self, $core) = splice @_, 0, 2;
Subroutine Cobalt_unregister: not called CC=1 SCAR=6.9
Pod undocumented
25  
26 0 $core->log->info("Unloaded");
27  
28 0 return PLUGIN_EAT_NONE
29 }
30  
31 0 ▶sub Bot_public_cmd_dailyfail { Bot_public_cmd_headline(@_) }
Subroutine Bot_public_cmd_dailyfail: not called CC=1 SCAR=6.9
Pod undocumented
32 sub Bot_public_cmd_headline {
33 0 ▶ my ($self, $core) = splice @_, 0, 2;
Subroutine Bot_public_cmd_headline: not called CC=2 SCAR=17.9
Pod undocumented
34  
35 0 my $msg = ${ $_[0] };
36 0 my $context = $msg->context;
37  
38 0 my $resp = get_headline();
39  
40 0 my $channel = $msg->channel;
41  
42 0 ▶ $core->send_event( 'send_message',
Branch: 1 branch
BranchTrueFalseTotal
if $resp 0 0 0
43 $context,
44 $channel,
45 "BREAKING: ".$resp
46 ) if $resp;
47
48 0 return PLUGIN_EAT_ALL
49 }
50  
51 1 1;
52 __END__
« Silly/LOLCAT.pm ↑ Summary Silly/BoneEasy.pm »