NewsExtractor/SiteSpecificExtractor/yimedia_com_tw.pm

filter: Statementstmt 52.1% 12 / 23 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 0.0% 0 / 1 totaltotal 40.5% 15 / 37 CC 5 SCAR 21.2
CC
5
Cov
39%
__ANON__
12.0
journalist
12.0
BEGIN
1.0
CRAP 8.3
« NewsExtractor/JSONLDExtractor.pm ↑ Summary NewsExtractor/SiteSpecificExtractor/ETtoday.pm »
1 package NewsExtractor::SiteSpecificExtractor::yimedia_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' => 'normalize_whitespace', 'u';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 0 ▶before 'content_text', sub {
Subroutine __ANON__: not called CC=3 SCAR=24.8
9 0 my ($self) = @_;
10 0 $self->dom->find('figure.fbyt-block')->map('remove');
11 0 ▶ if (my $el = $self->dom->at('#penci-post-entry-inner > p:last-of-type')) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $el = $self->dom->at("#penci-post-entry-inner > p:last-of-type")) 0 0 0
12 0 ▶ if ($el->content() =~ /\A看更多<br>/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($el->content =~ /\A\x{770b}\x{66f4}\x{591a}<br>/) 0 0 0
13 0 $el->remove();
14 }
15 }
16 1 };
17  
18 0 ▶sub journalist {
Subroutine journalist: not called CC=3 SCAR=24.8
Pod undocumented
19 0 my $self = $_[0];
20 0 my $ret;
21 0 ▶ if (my $el = $self->dom->at('#penci-post-entry-inner > p:nth-child(1)')) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $el = $self->dom->at("#penci-post-entry-inner > p:nth-child(1)")) 0 0 0
22 0 ▶ if ($el->content() =~ /文字撰稿:(?<name> \p{Letter}+ )<br>/x) {
Branch: 1 branch
BranchTrueFalseTotal
if ($el->content =~ /\x{6587}\x{5b57}\x{64b0}\x{7a3f}\x{ff1a}(?<name> \p{Letter}+ )<br>/x) 0 0 0
23 0 ($ret) = $+{"name"};
24 }
25  
26 }
27 0 return $ret;
28 }
29  
30 1 1;
« NewsExtractor/JSONLDExtractor.pm ↑ Summary NewsExtractor/SiteSpecificExtractor/ETtoday.pm »