NewsExtractor/Types.pm

filter: Statementstmt 91.3% 21 / 23 Branchbran 50.0% 1 / 2 Conditioncond 83.3% 5 / 6 MC/DCmcdc 66.6% 2 / 3 Subroutinesub 75.0% 6 / 8 Podpod n/a totaltotal 83.3% 35 / 42 CC 3 SCAR 5.0
CC
3
Cov
87%
__ANON__
3.1
__ANON__
1.1
__ANON__
1.1
CRAP 1.7
« NewsExtractor/SiteSpecificExtractor/money_udn_com.pm ↑ Summary NewsExtractor/SiteSpecificExtractor/www_allnews_tw.pm »
1 package NewsExtractor::Types;
2 3 ▶use v5.18;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 3 ▶use Importer 'NewsExtractor::Constants' => 'NEWSPAPER_NAMES';
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use Importer Encode => 'is_utf8';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 ▶use Type::Library -base;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 ▶use Type::Utils -all;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 3 extends "Types::Standard";
10  
11 26 ▶declare Text => as "Str", where {
Subroutine __ANON__: called CC=3 SCAR=11.3
12 26 ▶ ($_ eq '') || ( is_utf8($_) && ($_ !~ m/[^\P{PosixCntrl}\n]/) )
Branch: 1 branch
BranchTrueFalseTotal
$_ eq "" or &is_utf8($_) and not $_ =~ /[^\P{PosixCntrl}\n]/u 0 26 26
Condition83%5/6
$_ eq '' || &is_utf8($_) && !($_ =~ /[^\P{PosixCntrl}\n]/u)
l!l&&r!l&&!r
01511
&is_utf8($_) and not $_ =~ /[^\P{PosixCntrl}\n]/u
!ll&&!rl&&r
9215
MC/DC66%2/3
$_ eq '' || &is_utf8($_) && !($_ =~ /[^\P{PosixCntrl}\n]/u)
$_ eq '' &is_utf8($_) not $_ =~ /[^\P{PosixCntrl}\n]/u
Truth table75%3/4
A || B and not(C)
A= $_ eq ''B= &is_utf8($_)C= not $_ =~ /[^\P{PosixCntrl}\n]/u
ABCresult
1XX1
0111
00X0
0100
13 3 };
14  
15 0 ▶declare Text1K => as "Text", where { length($_) <= 1024 };
Subroutine __ANON__: not called CC=1 SCAR=1.2
16 0 ▶declare Text4K => as "Text", where { length($_) <= 4096 };
Subroutine __ANON__: not called CC=1 SCAR=1.2
17  
18 3 enum NewspaperName => NEWSPAPER_NAMES;
19  
20 3 1;
« NewsExtractor/SiteSpecificExtractor/money_udn_com.pm ↑ Summary NewsExtractor/SiteSpecificExtractor/www_allnews_tw.pm »