Zippy.pm

filter: Statementstmt 50.0% 11 / 22 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 60.0% 3 / 5 Podpod 100% 2 / 2 totaltotal 36.3% 16 / 44 CC 7 SCAR 35.9
CC
7
Cov
31%
said
56.0
help
2.0
BEGIN
1.0
CRAP 36.1
« Insult.pm ↑ Summary Summon.pm »
1 package Bot::BasicBot::Pluggable::Module::Zippy;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Bot::BasicBot::Pluggable::Module;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use base qw(Bot::BasicBot::Pluggable::Module);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 my @yows;
8  
9 0 ▶sub said {
Subroutine said: not called CC=7 SCAR=40.3
Pod documented
10 0 my ($self, $mess, $pri) = @_;
11  
12 0 my $body = $mess->{body};
13  
14 0 ▶ return unless $body =~ /^yow[!? ]*$/i or $body =~ /^be zippy\?*$/i;
Branch: 1 branch
BranchTrueFalseTotal
unless $body =~ /^yow[!? ]*$/i or $body =~ /^be zippy\?*$/i 0 0 0
Condition0%0/3
$body =~ /^yow[!? ]*$/i or $body =~ /^be zippy\?*$/i
l!l&&r!l&&!r
000
MC/DC0%0/2
$body =~ /^yow[!? ]*$/i or $body =~ /^be zippy\?*$/i
$body =~ /^yow[!? ]*$/i $body =~ /^be zippy\?*$/i
Truth table0%0/3
A or B
A= $body =~ /^yow[!? ]*$/iB= $body =~ /^be zippy\?*$/i
ABresult
1X1
011
000
15  
16 0 ▶ return unless ($pri == 2);
Branch: 1 branch
BranchTrueFalseTotal
unless $pri == 2 0 0 0
17  
18 0 ▶ unless (@yows) {
Branch: 1 branch
BranchTrueFalseTotal
unless (@yows) 0 0 0
19 0 ▶ while (<DATA>) { chomp; next if /^\s*$/; push @yows, $_; }
Branch: 2 branches
BranchTrueFalseTotal
if (defined($_ = readline DATA)) 0 0 0
if /^\s*$/ 0 0 0
20 }
21  
22 0 return $yows[rand(@yows)];
23 }
24  
25 0 ▶sub help {
Subroutine help: not called CC=1 SCAR=6.9
Pod documented
26 0 return "Commands: 'yow' or 'be zippy'";
27 }
28  
29 1 1;
30  
31 =head1 NAME
32  
33 Bot::BasicBot::Pluggable::Module::Zippy - module for Zippy the Pinhead quotes
34  
35 =head1 SYNOPSIS
36  
37 It's OBVIOUS ... The FURS never reached ISTANBUL ... You were an EXTRA
38 in the REMAKE of "TOPKAPI" ... Go home to your WIFE ... She's making
39 FRENCH TOAST!
40  
41 =head1 IRC USAGE
42  
43 [yow|be zippy]
44  
45 =head1 AUTHOR
46  
47 Simon Wistow, <simon@thegestalt.org>
48  
49 based on code by Rich Lafferty (mendel) <rich@vax2.concordia.ca>
50  
51 and data from fortune-mod-9708
52  
53 =head1 COPYRIGHT
54  
55 Copyright 2005, Simon Wistow
56  
57 Distributed under the same terms as Perl itself.
58  
59 =head1 SEE ALSO
60  
61 L<Math::Units>
62  
63 =cut
64  
65 __DATA__
« Insult.pm ↑ Summary Summon.pm »