Plugin/CSS/Minifier.pm

filter: Statementstmt 50.0% 14 / 28 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 44.4% 4 / 9 Podpod n/a totaltotal 40.9% 18 / 44 CC 4 SCAR 15.8
CC
4
Cov
41%
_make_response_message
12.0
_make_poco
6.0
_make_default_args
2.0
CRAP 4.8
« Plugin/AntiSpamMailTo.pm ↑ Summary Plugin/JavaScript/Minifier.pm »
1 package POE::Component::IRC::Plugin::CSS::Minifier;
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 base 'POE::Component::IRC::Plugin::BasePoCoWrap';
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use POE::Component::CSS::Minifier;
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 pastebin_trigger => '[irc_to_pastebin]',
14 response_event => 'irc_css_minifier',
15 trigger => qr/^minify\s*css\s+(?=\S)/i,
16 );
17 }
18  
19 0 ▶sub _make_poco {
Subroutine _make_poco: not called CC=2 SCAR=17.9
20 0 my $self = shift;
21 return POE::Component::CSS::Minifier->spawn(
22 debug => $self->{debug},
23 0 ▶ %{ $self->{obj_args} || {} },
Condition0%0/2
$self->{'obj_args'} || {}
l!l
00
MC/DC0%0/1
$self->{'obj_args'} || {}
$self->{'obj_args'}
Truth table0%0/2
A
A= $self->{'obj_args'}
Aresult
11
00
24 );
25 }
26  
27 0 ▶sub _make_response_message {
Subroutine _make_response_message: not called CC=3 SCAR=24.8
28 0 my $self = shift;
29 0 my $in_ref = shift;
30  
31 0 my $prefix = '';
32  
33 $in_ref->{_type} eq 'public'
34 0 ▶ and $prefix = (split /!/, $in_ref->{_who})[0] . ', ';
Branch: 1 branch
BranchTrueFalseTotal
$in_ref->{"_type"} eq "public" and $prefix = (split(/!/, $in_ref->{"_who"}, 0))[0] . ', ' 0 0 0
35  
36 exists $in_ref->{error}
37 0 ▶ and return "$prefix$in_ref->{error}";
Branch: 1 branch
BranchTrueFalseTotal
exists $in_ref->{"error"} and return qq[$prefix$in_ref->{"error"}] 0 0 0
38  
39 0 return "$prefix see $self->{pastebin_trigger}$in_ref->{out}";
40 }
41  
42 0 ▶sub _message_into_response_event { 'out' }
Subroutine _message_into_response_event: not called CC=1 SCAR=6.9
43  
44 0 ▶sub _make_poco_call {
Subroutine _make_poco_call: not called CC=1 SCAR=6.9
45 0 my $self = shift;
46 0 my $data_ref = shift;
47  
48 $self->{poco}->minify( {
49 event => '_poco_done',
50 uri => delete $data_ref->{what},
51 0 map +( "_$_" => $data_ref->{$_} ),
52 keys %$data_ref,
53 }
54 );
55 }
56 1 1;
57 __END__
« Plugin/AntiSpamMailTo.pm ↑ Summary Plugin/JavaScript/Minifier.pm »