App/PNGCrush.pm

filter: Statementstmt 51.2% 21 / 41 Branchbran 0.0% 0 / 12 Conditioncond 0.0% 0 / 10 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 63.6% 7 / 11 Podpod 100% 1 / 1 totaltotal 36.7% 29 / 79 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 WWW/Google/PageRank.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 = '1.001004'; # 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 sub _methods_define {
14 1 ▶ return ( run => '_wheel_entry' );
Subroutine _methods_define: called CC=1 SCAR=0.0
15 }
16  
17 sub run {
18 0 ▶ $poe_kernel->post( shift->{session_id} => run => @_ );
Subroutine run: not called CC=1 SCAR=6.9
Pod documented
19 }
20  
21 sub _check_args {
22 0 ▶ my ( $self, $args_ref ) = @_;
Subroutine _check_args: not called CC=5 SCAR=34.0
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 sub _prepare_wheel {
36 0 ▶ my $self = shift;
Subroutine _prepare_wheel: not called CC=2 SCAR=17.9
37 0 ▶ $self->{crush} = App::PNGCrush->new( %{ $self->{obj_args} || {} } );
Branch: 1 branch
BranchTrueFalseTotal
$self->{"obj_args"} or {} 0 0 0
38 }
39  
40 sub _process_request {
41 0 ▶ my ( $self, $in_ref ) = @_;
Subroutine _process_request: not called CC=5 SCAR=34.0
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} || [] } );
Branch: 1 branch
BranchTrueFalseTotal
$in_ref->{"options"} or [] 0 0 0
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 WWW/Google/PageRank.pm »