Rssfilter/Match/Duplicates.pm

filter: Statementstmt 100% 34 / 34 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 10 / 10 Podpod n/a totaltotal 100% 48 / 48 CC 3 SCAR 4.1
CC
3
Cov
100%
match
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.5
« Rssfilter/FromHash.pm ↑ Summary Rssfilter/Match/Category.pm »
1 # ABSTRACT: match an RSS item which has been seen before
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6  
7 package App::Rssfilter::Match::Duplicates;
8 3 $App::Rssfilter::Match::Duplicates::VERSION = '0.08'; # TRIAL
9 3 ▶use Method::Signatures;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 3 ▶use Try::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 3 ▶use List::MoreUtils qw< apply >;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13  
14 3 ▶func match ( $item ) {
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine match: called CC=3 SCAR=11.0
Branch: 2 branches
BranchTrueFalseTotal
unless scalar @_ > 0 1 15 16
if scalar @_ > 1 1 14 15
15 3 ▶ use feature 'state';
Subroutine BEGIN: called CC=1 SCAR=0.0
16 14 state %prev;
17  
18 my @matchables =
19 22 ▶ apply { s/ [?] .* \z //xms }
Subroutine __ANON__: called CC=1 SCAR=0.0
20 26 grep { $_ ne '' }
21 14 ▶ $item->find( 'guid, link' )->map( sub { $_->text } )->each;
Subroutine __ANON__: called CC=1 SCAR=0.0
22  
23 14 my $res = grep { defined } @prev{ @matchables };
24 14 @prev{ @matchables } = ( 1 ) x @matchables;
25 14 return 0 < $res;
26 }
27  
28 3 1;
29  
30 __END__
« Rssfilter/FromHash.pm ↑ Summary Rssfilter/Match/Category.pm »