Plugin/ColorNamer.pm

filter: Statementstmt 53.8% 14 / 26 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 57.1% 4 / 7 Podpod n/a totaltotal 46.1% 18 / 39 CC 4 SCAR 21.7
CC
4
Cov
44%
_make_response_message
20.0
_make_default_args
2.0
_message_into_response_event
2.0
CRAP 8.8
« Plugin/WWW/GetPageTitle.pm ↑ Summary Plugin/WWW/DoctypeGrabber.pm »
1 package POE::Component::IRC::Plugin::ColorNamer;
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 = '2.001004'; # VERSION
7  
8 1 ▶use App::ColorNamer;
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/^color\s*namer\s+(?=\S+$)/i,
14 response_event => 'irc_colornamer',
15 );
16 }
17  
18 0 ▶sub _make_response_message {
Subroutine _make_response_message: not called CC=4 SCAR=30.0
19 0 my ( $self, $in_ref ) = @_;
20  
21 0 my $is_sane_only = $in_ref->{what} =~ s/^://;
22  
23 0 my $app = App::ColorNamer->new;
24  
25 $app->sane_colors( $self->{sane_colors} )
26 0 ▶ if $self->{sane_colors};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"sane_colors"} 0 0 0
27  
28 0 my $name = $app->get_name( $in_ref->{what}, $is_sane_only );
29  
30 0 my $out;
31 0 ▶ if ( $name ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($name) { } 0 0 0
32 $out = "$name->{name} (#$name->{hex}"
33 0 ▶ . ( $name->{exact} ? ', exact match)' : ')' );
Branch: 1 branch
BranchTrueFalseTotal
$name->{'exact'} ? : 0 0 0
34 }
35 else {
36 0 $out = 'Error: ' . $app->error;
37 }
38  
39 0 return $out;
40 }
41  
42 0 ▶sub _message_into_response_event { 'result' }
Subroutine _message_into_response_event: not called CC=1 SCAR=6.9
43  
44 1 1;
45 __END__
« Plugin/WWW/GetPageTitle.pm ↑ Summary Plugin/WWW/DoctypeGrabber.pm »