Rssfilter/Match/Category.pm

filter: Statementstmt 77.7% 21 / 27 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod n/a totaltotal 80.5% 29 / 36 CC 2 SCAR 3.7
CC
2
Cov
79%
match
2.3
__ANON__
2.0
BEGIN
1.0
CRAP 1.5
« Rssfilter/FromHash.pm ↑ Summary Rssfilter/Logger.pm »
1 # ABSTRACT: match an RSS item by category
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::Category;
8 {
9 1 $App::Rssfilter::Match::Category::VERSION = '0.07';
10 }
11 1 ▶use Method::Signatures;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use List::MoreUtils qw( any );
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14  
15 1 ▶func match ( $item, @bad_cats ) {
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine match: called CC=2 SCAR=8.4
Branch: 1 branch
BranchTrueFalseTotal
unless scalar @_ > 0 1 2 3
16 2 my @categories = $item->find("category")->pluck( 'text' )->each;
17 0 my @split_categories = map { ( / \A ( [^:]+ ) ( [:] .* ) \z /xms, $_ ) } @categories;
18 0 my %cats = map { $_ => 1 } @split_categories;
19 0 ▶ return List::MoreUtils::any { defined $_ } @cats{ @bad_cats };
Subroutine __ANON__: not called CC=1 SCAR=6.9
20 }
21  
22 1 1;
23  
24 __END__
« Rssfilter/FromHash.pm ↑ Summary Rssfilter/Logger.pm »