App/PNGCrush.pm

filter: Statementstmt 51.2% 21 / 41 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 14 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 63.6% 7 / 11 Podpod 100% 1 / 1 totaltotal 35.8% 29 / 81 CC 10 SCAR 27.8
CC
10
Cov
33%
_check_args
30.0
_process_request
30.0
_prepare_wheel
6.0
CRAP 16.1
« Syntax/Highlight/HTML.pm ↑ Summary WebService/Validator/CSS/W3C.pm »
1 package POE::Component::App::PNGCrush;
2  
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 our $VERSION = '2.001002'; # VERSION
7  
8 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use POE;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use base 'POE::Component::NonBlockingWrapper::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use App::PNGCrush;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 ▶sub _methods_define {
Subroutine _methods_define: called CC=1 SCAR=0.0
14 1 return ( run => '_wheel_entry' );
15 }
16  
17 0 ▶sub run {
Subroutine run: not called CC=1 SCAR=6.9
Pod documented
18 0 $poe_kernel->post( shift->{session_id} => run => @_ );
19 }
20  
21 0 ▶sub _check_args {
Subroutine _check_args: not called CC=5 SCAR=34.0
22 0 my ( $self, $args_ref ) = @_;
23  
24 exists $args_ref->{in}
25 0 ▶ or carp "Missing `in` argument"
Branch: 1 branch
BranchTrueFalseTotal
exists $args_ref->{"in"} or carp("Missing `in` argument") and return 0 0 0
Condition0%0/5
exists $args_ref->{'in'} || carp('Missing `in` argument') && (return)
l!l&&r!l&&!r
000
carp("Missing `in` argument") and return
!ll
00
MC/DC0%0/2
exists $args_ref->{'in'} || carp('Missing `in` argument') && (return)
exists $args_ref->{'in'} carp("Missing `in` argument")
Truth table0%0/3
A || B
A= exists $args_ref->{'in'}B= carp("Missing `in` argument")
ABresult
1X1
011
000
26 and return;
27  
28 exists $args_ref->{options}
29 0 ▶ or carp "Missing `options` argument"
Branch: 1 branch
BranchTrueFalseTotal
exists $args_ref->{"options"} or carp("Missing `options` argument") and return 0 0 0
Condition0%0/5
exists $args_ref->{'options'} || carp('Missing `options` argument') && (return)
l!l&&r!l&&!r
000
carp("Missing `options` argument") and return
!ll
00
MC/DC0%0/2
exists $args_ref->{'options'} || carp('Missing `options` argument') && (return)
exists $args_ref->{'options'} carp("Missing `options` argument")
Truth table0%0/3
A || B
A= exists $args_ref->{'options'}B= carp("Missing `options` argument")
ABresult
1X1
011
000
30 and return;
31  
32 0 return 1;
33 }
34  
35 0 ▶sub _prepare_wheel {
Subroutine _prepare_wheel: not called CC=2 SCAR=17.9
36 0 my $self = shift;
37 0 ▶ $self->{crush} = App::PNGCrush->new( %{ $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
38 }
39  
40 0 ▶sub _process_request {
Subroutine _process_request: not called CC=5 SCAR=34.0
41 0 my ( $self, $in_ref ) = @_;
42 0 ▶ unless ( ref $in_ref->{in} eq 'ARRAY' ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (ref $in_ref->{"in"} eq "ARRAY") 0 0 0
43 0 $in_ref->{in} = [ $in_ref->{in} ];
44 }
45  
46 0 my $crush = $self->{crush};
47  
48 0 ▶ $crush->set_options( @{ $in_ref->{options} || [] } );
Condition0%0/2
$in_ref->{'options'} || []
l!l
00
MC/DC0%0/1
$in_ref->{'options'} || []
$in_ref->{'options'}
Truth table0%0/2
A
A= $in_ref->{'options'}
Aresult
11
00
49  
50 0 for ( @{ $in_ref->{in} } ) {
51 0 my $out_ref = $crush->run( $_ );
52 0 ▶ unless ( defined $out_ref ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $out_ref) 0 0 0
53 0 $out_ref = $crush->error;
54 }
55 0 $in_ref->{out}{ $_ } = $out_ref;
56 }
57 }
58  
59 2 1;
60 __END__
« Syntax/Highlight/HTML.pm ↑ Summary WebService/Validator/CSS/W3C.pm »