Rssfilter/Match/AbcPreviews.pm

filter: Statementstmt 100% 21 / 21 Branchbran 100% 4 / 4 Conditioncond 66.6% 6 / 9 MC/DCmcdc 50.0% 3 / 6 Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 86.6% 39 / 45 CC 6 SCAR 14.0
CC
6
Cov
91%
match
6.1
BEGIN
1.0
BEGIN
1.0
CRAP 4.0
« Rssfilter/Feed.pm ↑ Summary Rssfilter/Rule.pm »
1 # ABSTRACT: match an ABC preview RSS item
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6  
7 package App::Rssfilter::Match::AbcPreviews;
8 1 $App::Rssfilter::Match::AbcPreviews::VERSION = '0.08'; # TRIAL
9 1 ▶use Method::Signatures;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11  
12 1 ▶func match ( $item ) {
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine match: called CC=6 SCAR=18.0
Branch: 2 branches
BranchTrueFalseTotal
unless scalar @_ > 0 1 4 5
if scalar @_ > 1 1 3 4
13 3 my $guid = $item->at('guid');
14 3 my $title = $item->at('title');
15 3 ▶ my $guid_preview = defined $guid && $guid->text =~ / [^-] preview /xms;
Condition66%2/3
defined $guid && $guid->text =~ / [^-] preview /msx
!ll&&!rl&&r
021
MC/DC50%1/2
defined $guid && $guid->text =~ / [^-] preview /msx
defined $guid $guid->text =~ / [^-] preview /msx
Truth table66%2/3
A && B
A= defined $guidB= $guid->text =~ / [^-] preview /msx
ABresult
0X0
100
111
16 3 ▶ my $title_no_preview = defined $title && $title->text =~ / preview /ixms;
Condition66%2/3
defined $title && $title->text =~ / preview /imsx
!ll&&!rl&&r
201
MC/DC50%1/2
defined $title && $title->text =~ / preview /imsx
defined $title $title->text =~ / preview /imsx
Truth table66%2/3
A && B
A= defined $titleB= $title->text =~ / preview /imsx
ABresult
0X0
100
111
17 3 ▶ return $guid_preview && ! $title_no_preview;
Condition66%2/3
$guid_preview && !$title_no_preview
!ll&&!rl&&r
201
MC/DC50%1/2
$guid_preview && !$title_no_preview
$guid_preview !$title_no_preview
Truth table66%2/3
A && not(B)
A= $guid_previewB= !$title_no_preview
ABresult
0X0
100
111
18 }
19  
20 1 1;
21  
22 __END__
« Rssfilter/Feed.pm ↑ Summary Rssfilter/Rule.pm »