Feed/Actions/List.pm

filter: Statementstmt 55.0% 11 / 20 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 51.7% 15 / 29 CC 3 SCAR 18.7
CC
3
Cov
46%
ls
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 6.5
« Feed/Actions/Fetch.pm ↑ Summary Feed.pm »
1 package Cnutt::Feed::Actions::List;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 =head1 NAME
7  
8 Cnutt::Feed::Actions::List - List the feeds of a webpage
9  
10 =head1 VERSION
11  
12 Version 1.0
13  
14 =cut
15  
16 2 our $VERSION = '1.0';
17  
18 =head1 DESCRIPTION
19  
20 This file is part of cnutt-feed. You should read its documentation.
21  
22 =cut
23  
24 2 ▶use XML::Feed;
Subroutine BEGIN: called CC=1 SCAR=0.0
25  
26 =head2 ls
27  
28 Given an url, display the list of feeds found on the page.
29  
30 =cut
31  
32 0 ▶sub ls {
Subroutine ls: not called CC=3 SCAR=24.8
Pod documented
33 0 my ($roptions, $url) = @_;
34 0 my %options = %{$roptions};
35  
36 0 ▶ print "Searching feeds in $url...\n" if $options{verbose};
Branch: 1 branch
BranchTrueFalseTotal
if $options{"verbose"} 0 0 0
37  
38 # get the feeds list
39 0 my @feeds = XML::Feed->find_feeds($url);
40  
41 # print list
42 0 map {print $_, "\n"} @feeds;
43  
44 0 my $count = @feeds;
45 0 ▶ print "Found $count feed(s)\n" if $options{verbose};
Branch: 1 branch
BranchTrueFalseTotal
if $options{"verbose"} 0 0 0
46 }
47  
48 2 1;
49  
« Feed/Actions/Fetch.pm ↑ Summary Feed.pm »