NewsExtractor/SiteSpecificExtractor/www_setn_com.pm

filter: Statementstmt 57.8% 11 / 19 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 1 totaltotal 45.1% 14 / 31 CC 4 SCAR 24.7
CC
4
Cov
46%
journalist
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 11.9
« NewsExtractor/Role/ContentTextExtractor.pm ↑ Summary NewsExtractor/SiteSpecificExtractor/www_ustv_com_tw.pm »
1 package NewsExtractor::SiteSpecificExtractor::www_setn_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' => 'normalize_whitespace';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 0 ▶sub journalist {
Subroutine journalist: not called CC=4 SCAR=30.0
Pod undocumented
9 0 my ($self) = @_;
10 0 my $content_text = $self->content_text;
11  
12 0 my @patterns = (
13 qr{\b記者\s*([\p{Letter}、]+?)\s*/\s*(?:\p{Letter}+?)報導\b},
14 qr{\b文/([\p{Letter}、]+)\b},
15 qr{\b (?:三立準氣象 | \p{Letter}{2} 中心) / (\p{Letter}+?) 報導\b}x,
16 qr{\b健康醫療網記者(\p{Letter}+?)/報導\n}x,
17 qr{\b助理編輯/(\p{Letter}+?)\n}x
18 );
19  
20 0 my $name;
21  
22 0 for my $pat (@patterns) {
23 0 ($name) = $content_text =~ $pat;
24 0 ▶ last if defined $name;
Branch: 1 branch
BranchTrueFalseTotal
if defined $name 0 0 0
25 }
26  
27 0 ▶ return $name && normalize_whitespace($name);
Condition0%0/3
$name && normalize_whitespace($name)
!ll&&!rl&&r
000
MC/DC0%0/2
$name && normalize_whitespace($name)
$name normalize_whitespace($name)
Truth table0%0/3
A && B
A= $nameB= normalize_whitespace($name)
ABresult
0X0
100
111
28 }
29  
30 1 1;
« NewsExtractor/Role/ContentTextExtractor.pm ↑ Summary NewsExtractor/SiteSpecificExtractor/www_ustv_com_tw.pm »