Traceroute.pm

filter: Statementstmt 50.0% 13 / 26 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 4 / 6 Podpod 100% 2 / 2 totaltotal 45.2% 19 / 42 CC 5 SCAR 27.5
CC
5
Cov
38%
said
30.0
help
2.0
BEGIN
1.0
CRAP 15.6
« Whois.pm ↑ Summary
1 package Bot::BasicBot::Pluggable::Module::Traceroute;
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 ▶use Net::Traceroute;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 0 ▶sub said {
Subroutine said: not called CC=5 SCAR=34.0
Pod documented
10 0 my ($self, $mess, $pri) = @_;
11  
12 0 my $body = $mess->{body};
13 0 my $who = $mess->{who};
14  
15 0 ▶ return unless ($pri == 2);
Branch: 1 branch
BranchTrueFalseTotal
unless $pri == 2 0 0 0
16 0 ▶ return unless $body =~ m!\s*traceroute\s+([\w\.]+)!;
Branch: 1 branch
BranchTrueFalseTotal
unless $body =~ /\s*traceroute\s+([\w\.]+)/ 0 0 0
17
18 0 my $host = $1;
19
20
21 0 my $t;
22 0 eval { $t = Net::Traceroute->new( host => $host ) };
23  
24 0 ▶ return "Hrmm, couldn't traceroute to $host - $@" if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 0 0
25 0 ▶ return "Hrmm, couldn't traceroute to $host cos I can't find it" if !$t->found;
Branch: 1 branch
BranchTrueFalseTotal
unless $t->found 0 0 0
26
27 0 return $t->hop_query_host($t->hops,0);
28 }
29  
30 0 ▶sub help {
Subroutine help: not called CC=1 SCAR=6.9
Pod documented
31 0 return "Commands: 'traceroute <host>";
32 }
33  
34 1 1;
35  
36 =head1 NAME
37  
38 Bot::BasicBot::Pluggable::Module::Traceroute - do a traceroute for a host
39  
40 =head1 IRC USAGE
41  
42 traceroute <host>
43  
44 =head1 AUTHOR
45  
46 Simon Wistow, <simon@thegestalt.org>
47  
48 =head1 COPYRIGHT
49  
50 Copyright 2005, Simon Wistow
51  
52 Distributed under the same terms as Perl itself.
53  
54 =head1 SEE ALSO
55  
56  
57 =cut
58  
« Whois.pm ↑ Summary