| 1 | package POE::Component::WWW::Alexa::TrafficRank; | ||||||||||||||
| 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 POE; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 9 | 2 | ▶ | use base 'POE::Component::NonBlockingWrapper::Base'; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 10 | 2 | ▶ | use WWW::Alexa::TrafficRank; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 11 | |||||||||||||||
| 12 | 1 | ▶ | sub _methods_define { | ||||||||||||
|
Subroutine
_methods_define: called CC=1 SCAR=0.0
| |||||||||||||||
| 13 | 1 | return ( rank => '_wheel_entry' ); | |||||||||||||
| 14 | } | ||||||||||||||
| 15 | |||||||||||||||
| 16 | 1 | ▶ | sub rank { | ||||||||||||
|
Subroutine
rank: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||
| 17 | 1 | $poe_kernel->post( shift->{session_id} => rank => @_ ); | |||||||||||||
| 18 | } | ||||||||||||||
| 19 | |||||||||||||||
| 20 | 0 | ▶ | sub _prepare_wheel { | ||||||||||||
|
Subroutine
_prepare_wheel: not called CC=3 SCAR=24.8
| |||||||||||||||
| 21 | 0 | my $self = shift; | |||||||||||||
| 22 | 0 | ▶ | $self->{timeout} ||= 30; | ||||||||||||
|
Condition0%0/2
$self->{"timeout"} ||= 30
MC/DC0%0/1
$self->{"timeout"} ||= 30
$self->{"timeout"}
Truth table0%0/2
A
A= $self->{"timeout"}
| |||||||||||||||
| 23 | $self->{obj} = WWW::Alexa::TrafficRank->new( | ||||||||||||||
| 24 | 0 | ▶ | map { defined $self->{$_} ? ( $_ => $self->{$_} ) : () } | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 25 | qw/agent proxy timeout/ | ||||||||||||||
| 26 | ); | ||||||||||||||
| 27 | } | ||||||||||||||
| 28 | |||||||||||||||
| 29 | 0 | ▶ | sub _process_request { | ||||||||||||
|
Subroutine
_process_request: not called CC=3 SCAR=24.8
| |||||||||||||||
| 30 | 0 | my ( $self, $in_ref ) = @_; | |||||||||||||
| 31 | 0 | $in_ref->{uri} =~ s{^(?:ht|f)tps?://|/$}{}gi; | |||||||||||||
| 32 | 0 | $in_ref->{rank} = $self->{obj}->get( $in_ref->{uri} ); | |||||||||||||
| 33 | 0 | ▶ | if ( not length $in_ref->{rank} ) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 34 | 0 | $in_ref->{error} = 'No result'; | |||||||||||||
| 35 | 0 | delete $in_ref->{rank}; | |||||||||||||
| 36 | } | ||||||||||||||
| 37 | elsif ( $in_ref->{rank} !~ /^[\d,]+$/ ) { | ||||||||||||||
| 38 | 0 | $in_ref->{error} = delete $in_ref->{rank}; | |||||||||||||
| 39 | } | ||||||||||||||
| 40 | } | ||||||||||||||
| 41 | |||||||||||||||
| 42 | 2 | 1; | |||||||||||||
| 43 | __END__ | ||||||||||||||