| 1 | package WWW::GoKGS::Scraper::Declare; | ||||||||||||
| 2 | 15 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 15 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 15 | ▶ | use parent qw/Web::Scraper/; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 15 | ▶ | use HTML::TreeBuilder::XPath; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | |||||||||||||
| 7 | 7 | ▶ | sub _tree_builder_class { | ||||||||||
|
Subroutine
_tree_builder_class: called CC=3 SCAR=11.7
| |||||||||||||
| 8 | 7 | my $self = shift; | |||||||||||
| 9 | 7 | ▶ | $self->{_tree_builder_class} = shift if @_; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 10 | 7 | ▶ | $self->{_tree_builder_class} ||= 'HTML::TreeBuilder::XPath'; | ||||||||||
|
Condition50%1/2
$self->{"_tree_builder_class"} ||= "HTML::TreeBuilder::XPath"
MC/DC0%0/1
$self->{"_tree_builder_class"} ||= "HTML::TreeBuilder::XPath"
$self->{"_tree_builder_class"}
Truth table50%1/2
A
A= $self->{"_tree_builder_class"}
| |||||||||||||
| 11 | } | ||||||||||||
| 12 | |||||||||||||
| 13 | 0 | ▶ | sub build_tree { | ||||||||||
|
Subroutine
build_tree: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 14 | 0 | my ( $self, $html ) = @_; | |||||||||||
| 15 | 0 | my $tree = $self->_tree_builder_class->new; | |||||||||||
| 16 | 0 | $tree->store_comments(1); | |||||||||||
| 17 | 0 | $tree->ignore_unknown(0); | |||||||||||
| 18 | 0 | $tree->parse($html); | |||||||||||
| 19 | 0 | $tree->eof; | |||||||||||
| 20 | 0 | $tree; | |||||||||||
| 21 | } | ||||||||||||
| 22 | |||||||||||||
| 23 | 15 | 1; | |||||||||||