Plugin/CoinFlip.pm

filter: Statementstmt 73.6% 14 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 57.1% 4 / 7 Podpod n/a totaltotal 69.2% 18 / 26 CC 1 SCAR 3.6
CC
1
Cov
74%
_make_default_args
2.0
_make_response_message
2.0
_message_into_response_event
2.0
CRAP 1.4
« Plugin/Magic8Ball.pm ↑ Summary Plugin/YouAreDoingItWrong.pm »
1 package POE::Component::IRC::Plugin::CoinFlip;
2  
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 our $VERSION = '1.001003'; # VERSION
7  
8 1 ▶use POE;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use base 'POE::Component::IRC::Plugin::BaseWrap';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 0 ▶sub _make_default_args {
Subroutine _make_default_args: not called CC=1 SCAR=6.9
12 return (
13 0 trigger => qr/^(?=flip$)/i,
14 response_event => 'irc_coin_flip',
15 );
16 }
17  
18 0 ▶sub _make_response_message {
Subroutine _make_response_message: not called CC=1 SCAR=6.9
19 0 my ( $self, $in_ref ) = @_;
20 0 my $nick = (split /!/, $in_ref->{who})[0];
21 0 return "$nick, " . qw/heads tails/[rand 2];
22 }
23  
24 0 ▶sub _message_into_response_event { 'flip' }
Subroutine _message_into_response_event: not called CC=1 SCAR=6.9
25  
26 1 1;
27 __END__
« Plugin/Magic8Ball.pm ↑ Summary Plugin/YouAreDoingItWrong.pm »