| 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
Condition0%0/5
exists $args_ref->{'in'} || carp('Missing `in` argument') && (return)
carp("Missing `in` argument") and return
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")
| |||||||||||||||||||||||||||||||||
| 26 | and return; | ||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||
| 28 | exists $args_ref->{options} | ||||||||||||||||||||||||||||||||
| 29 | 0 | ▶ | or carp "Missing `options` argument" | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/5
exists $args_ref->{'options'} || carp('Missing `options` argument') && (return)
carp("Missing `options` argument") and return
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")
| |||||||||||||||||||||||||||||||||
| 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'} || {}
MC/DC0%0/1
$self->{'obj_args'} || {}
$self->{'obj_args'}
Truth table0%0/2
A
A= $self->{'obj_args'}
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 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'} || []
MC/DC0%0/1
$in_ref->{'options'} || []
$in_ref->{'options'}
Truth table0%0/2
A
A= $in_ref->{'options'}
| |||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||
| 50 | 0 | for ( @{ $in_ref->{in} } ) { | |||||||||||||||||||||||||||||||
| 51 | 0 | my $out_ref = $crush->run( $_ ); | |||||||||||||||||||||||||||||||
| 52 | 0 | ▶ | unless ( defined $out_ref ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 53 | 0 | $out_ref = $crush->error; | |||||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||||||
| 55 | 0 | $in_ref->{out}{ $_ } = $out_ref; | |||||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||
| 59 | 2 | 1; | |||||||||||||||||||||||||||||||
| 60 | __END__ | ||||||||||||||||||||||||||||||||