NewsExtractor/SiteSpecificExtractor/m_news_cctv_com.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/www_ntdtv_com.pm ↑ Summary NewsExtractor/SiteSpecificExtractor/www_ttv_com_tw.pm »
1 package NewsExtractor::SiteSpecificExtractor::m_news_cctv_com;
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' => qw(normalize_whitespace reformat_dateline);
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('span.info i') or return;
Branch: 1 branch
BranchTrueFalseTotal
my $el = $self->dom->at("span.info i") or return 0 0 0
11 0 return reformat_dateline( $el->all_text(), '+08:00' );
12 }
13  
14 0 ▶sub journalist {
Subroutine journalist: not called CC=1 SCAR=6.9
Pod undocumented
15 0 my ($self) = @_;
16 0 my ($txt) = $self->content_text() =~ m/( (?:总台记者|编辑) (.+?))\z/xg;
17 0 $txt = normalize_whitespace($txt);
18 0 return $txt;
19 }
20  
21 1 1;
« NewsExtractor/SiteSpecificExtractor/www_ntdtv_com.pm ↑ Summary NewsExtractor/SiteSpecificExtractor/www_ttv_com_tw.pm »