NewsExtractor/SiteSpecificExtractor/www_ttv_com_tw.pm

filter: Statementstmt 61.1% 11 / 18 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 0.0% 0 / 2 totaltotal 51.8% 14 / 27 CC 2 SCAR 10.4
CC
2
Cov
55%
dateline
6.0
journalist
2.0
BEGIN
1.0
CRAP 2.8
« NewsExtractor/SiteSpecificExtractor/m_news_cctv_com.pm ↑ Summary NewsExtractor/SiteSpecificExtractor/www_nownews_com.pm »
1 package NewsExtractor::SiteSpecificExtractor::www_ttv_com_tw;
2 1 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 extends 'NewsExtractor::GenericExtractor';
5  
6 1 ▶use Importer 'NewsExtractor::TextUtil' => 'u';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 0 ▶sub dateline {
Subroutine dateline: not called CC=2 SCAR=17.9
Pod undocumented
9 0 my ($self) = @_;
10 0 ▶ my $el = $self->dom->at(".ReportDate > a:nth-child(1)") or return;
Branch: 1 branch
BranchTrueFalseTotal
my $el = $self->dom->at(".ReportDate > a:nth-child(1)") or return 0 0 0
11 0 my ($yyyy, $mm, $dd) = split /-/, $el->all_text;
12 0 return u(sprintf('%04d/%02d/%02d', $yyyy, $mm, $dd));
13 }
14  
15 0 ▶sub journalist {
Subroutine journalist: not called CC=1 SCAR=6.9
Pod undocumented
16 0 my ($self) = @_;
17 0 my ($name) = $self->content_text =~ m{(記者\s*([^/]+?)\s*/.+?報導)};
18 0 return $name;
19 }
20  
21 1 1;
« NewsExtractor/SiteSpecificExtractor/m_news_cctv_com.pm ↑ Summary NewsExtractor/SiteSpecificExtractor/www_nownews_com.pm »