WWW/DoctypeGrabber.pm

filter: Statementstmt 56.6% 17 / 30 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 55.5% 5 / 9 Podpod 100% 1 / 1 totaltotal 48.9% 23 / 47 CC 4 SCAR 15.6
CC
4
Cov
47%
_process_request
12.0
_prepare_wheel
6.0
_methods_define
2.0
CRAP 4.8
« WWW/Alexa/TrafficRank.pm ↑ Summary WWW/HTMLTagAttributeCounter.pm »
1 package POE::Component::WWW::DoctypeGrabber;
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::DoctypeGrabber;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 0 ▶sub _methods_define {
Subroutine _methods_define: not called CC=1 SCAR=6.9
13 0 return ( grab => '_wheel_entry' );
14 }
15  
16 0 ▶sub grab {
Subroutine grab: not called CC=1 SCAR=6.9
Pod documented
17 0 $poe_kernel->post( shift->{session_id} => grab => @_ );
18 }
19  
20 0 ▶sub _prepare_wheel {
Subroutine _prepare_wheel: not called CC=2 SCAR=17.9
21 0 my $self = shift;
22 $self->{obj} = WWW::DoctypeGrabber->new(
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 _process_request {
Subroutine _process_request: not called CC=3 SCAR=24.8
28 0 my ( $self, $in_ref ) = @_;
29  
30 0 my $grabber = $self->{obj};
31 0 ▶ if ( exists $in_ref->{raw} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $in_ref->{"raw"}) 0 0 0
32 0 $grabber->raw( $in_ref->{raw} );
33 }
34 0 my $grab = $grabber->grab( $in_ref->{page} );
35 0 ▶ if ( $grab ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($grab) { } 0 0 0
36 0 $in_ref->{result} = $grab;
37 }
38 else {
39 0 $in_ref->{error} = $grabber->error;
40 }
41 }
42  
43 2 1;
44 __END__
« WWW/Alexa/TrafficRank.pm ↑ Summary WWW/HTMLTagAttributeCounter.pm »