Rssfilter/Match/Duplicates.pm

filter: Statementstmt 78.1% 25 / 32 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 83.7% 36 / 43 CC 3 SCAR 5.8
CC
3
Cov
81%
match
3.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.8
« Rssfilter/Match/BbcSports.pm ↑ Summary Rssfilter/FromYaml.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 {
9 3 $App::Rssfilter::Match::Duplicates::VERSION = '0.07';
10 }
11 3 ▶use Method::Signatures;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 3 ▶use Try::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14  
15 3 ▶func match ( $item ) {
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine match: called CC=3 SCAR=12.0
Branch: 2 branches
BranchTrueFalseTotal
unless scalar @_ > 0 1 5 6
if scalar @_ > 1 1 4 5
16 3 ▶ use feature 'state';
Subroutine BEGIN: called CC=1 SCAR=0.0
17 4 state %prev;
18  
19 my @matchables =
20 0 map { s/ [?] .* \z //xms; $_ }
21 0 grep { $_ ne '' }
22 $item->find( 'guid, link' )->pluck( 'text' )->each;
23  
24 0 my $res = grep { defined } @prev{ @matchables };
25 0 @prev{ @matchables } = ( 1 ) x @matchables;
26 0 return 0 < $res;
27 }
28  
29 3 1;
30  
31 __END__
« Rssfilter/Match/BbcSports.pm ↑ Summary Rssfilter/FromYaml.pm »