blib/lib/WWW/GoKGS/Scraper/TournInfo.pm

filter: Statementstmt 60.6% 20 / 33 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 58.3% 7 / 12 Podpod 100% 2 / 2 totaltotal 56.8% 29 / 51 CC 3 SCAR 9.8
CC
3
Cov
54%
__ANON__
6.0
scrape
6.0
__ANON__
2.0
CRAP 2.7
« blib/lib/WWW/GoKGS/Scraper/TzList.pm ↑ Summary blib/lib/WWW/GoKGS.pm »
1 package WWW::GoKGS::Scraper::TournInfo;
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/WWW::GoKGS::Scraper/;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 15 ▶use WWW::GoKGS::Scraper::Declare;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 15 ▶use WWW::GoKGS::Scraper::TournLinks;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 16 ▶sub base_uri { 'http://www.gokgs.com/tournInfo.jsp' }
Subroutine base_uri: called CC=1 SCAR=0.0
Pod documented
9  
10 1 ▶sub __build_scraper {
Subroutine __build_scraper: called CC=1 SCAR=3.5
11 1 my $self = shift;
12 1 my $links = $self->__build_tourn_links;
13  
14 0 ▶ scraper {
Subroutine __ANON__: not called CC=1 SCAR=6.9
15 0 ▶ process '//h1', 'name' => [ 'TEXT', sub { s/\s+\([^)]+\)$// } ],
Subroutine __ANON__: not called CC=1 SCAR=6.9
16 0 ▶ 'notes' => [ 'TEXT', sub { m/\s+\(([^)]+)\)$/ && $1 } ];
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
/\s+\(([^)]+)\)$/ and $1 0 0 0
17 0 process '//a[@href="tzList.jsp"]', 'time_zone' => 'TEXT';
18 process '//node()[preceding-sibling::h1 and following-sibling::div]',
19 0 ▶ 'description[]' => sub { $_[0]->as_XML };
Subroutine __ANON__: not called CC=1 SCAR=6.9
20 0 process '//div[@class="tournData"]', 'links' => $links;
21 1 };
22 }
23  
24 0 ▶sub scrape {
Subroutine scrape: not called CC=2 SCAR=17.9
Pod documented
25 0 my ( $self, @args ) = @_;
26 0 my $result = $self->SUPER::scrape( @args );
27  
28 0 ▶ if ( exists $result->{description} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $result->{"description"}) 0 0 0
29 0 $result->{description} = join q{}, @{$result->{description}};
30 }
31  
32 0 $result;
33 }
34  
35 15 1;
36  
37 __END__
« blib/lib/WWW/GoKGS/Scraper/TzList.pm ↑ Summary blib/lib/WWW/GoKGS.pm »