WWW/DoctypeGrabber.pm

filter: Statementstmt 56.6% 17 / 30 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 55.5% 5 / 9 Podpod 100% 1 / 1 totaltotal 50.0% 23 / 46 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 = '1.001004'; # 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 sub _methods_define {
13 0 ▶ return ( grab => '_wheel_entry' );
Subroutine _methods_define: not called CC=1 SCAR=6.9
14 }
15  
16 sub grab {
17 0 ▶ $poe_kernel->post( shift->{session_id} => grab => @_ );
Subroutine grab: not called CC=1 SCAR=6.9
Pod documented
18 }
19  
20 sub _prepare_wheel {
21 0 ▶ my $self = shift;
Subroutine _prepare_wheel: not called CC=2 SCAR=17.9
22 $self->{obj} = WWW::DoctypeGrabber->new(
23 0 ▶ %{ $self->{obj_args} || {} },
Branch: 1 branch
BranchTrueFalseTotal
$self->{"obj_args"} or {} 0 0 0
24 );
25 }
26  
27 sub _process_request {
28 0 ▶ my ( $self, $in_ref ) = @_;
Subroutine _process_request: not called CC=3 SCAR=24.8
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 »