NewsExtractor/SiteSpecificExtractor/news_ttv_com_tw.pm

filter: Statementstmt 47.8% 11 / 23 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 0.0% 0 / 2 totaltotal 41.1% 14 / 34 CC 4 SCAR 18.5
CC
4
Cov
41%
journalist
12.0
dateline
6.0
BEGIN
1.0
CRAP 6.4
« NewsExtractor/SiteSpecificExtractor/newtalk_tw.pm ↑ Summary NewsExtractor/SiteSpecificExtractor/www_twreporter_org.pm »
1 package NewsExtractor::SiteSpecificExtractor::news_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' => qw(u 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("li.date.time") or return;
Branch: 1 branch
BranchTrueFalseTotal
my $el = $self->dom->at("li.date.time") or return 0 0 0
11 0 my $t = $el->all_text;
12 0 reformat_dateline( $t, '+08:00' );
13 }
14  
15 0 ▶sub journalist {
Subroutine journalist: not called CC=3 SCAR=24.8
Pod undocumented
16 0 my ($self) = @_;
17  
18 0 my $x;
19 0 my $t = $self->content_text;
20 0 my @regexps = (
21 qr{(記者\s*([^/]+?)\s*/.+?報導)},
22 qr{(責任編輯/\p{Letter}+)\z},
23 );
24  
25 0 for my $re (@regexps) {
26 0 ($x) = $t =~ /$re/;
27 0 ▶ last if $x;
Branch: 1 branch
BranchTrueFalseTotal
if $x 0 0 0
28 }
29  
30 0 return $x;
31 }
32  
33 1 1;
« NewsExtractor/SiteSpecificExtractor/newtalk_tw.pm ↑ Summary NewsExtractor/SiteSpecificExtractor/www_twreporter_org.pm »