blib/lib/Parse/Flexget.pm

filter: Statementstmt 88.8% 24 / 27 Branchbran 62.5% 5 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 85.7% 36 / 42 CC 6 SCAR 14.7
CC
6
Cov
83%
flexparse
7.1
BEGIN
1.0
BEGIN
1.0
CRAP 4.3
↑ Summary
1 package Parse::Flexget;
2 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 3 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶ use Exporter;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶ use vars qw($VERSION @ISA @EXPORT_OK);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 3 $VERSION = '0.018';
9 3 @ISA = qw(Exporter);
10  
11 3 @EXPORT_OK = qw(
12 flexparse
13 );
14 }
15  
16 3 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 1 ▶sub flexparse {
Subroutine flexparse: called CC=6 SCAR=19.6
Pod documented
19 1 my @data;
20 1 ▶ if(ref($_[0]) eq 'ARRAY') {
Branch: 2 branches
BranchTrueFalseTotal
if (ref $_[0] eq 'ARRAY') { } 0 1 1
elsif (ref $_[0] eq '') { } 1 0 1
21 0 push(@data, @{$_[0]});
22 }
23 elsif(ref($_[0]) eq '') {
24 1 push(@data, @_);
25 }
26 else {
27 0 croak("Reference type " . ref($_[0]) . " not supported\n");
28 }
29  
30 1 my @downloads;
31 1 for my $element(@data) {
32 44 ▶ if($element =~ m/Downloading: (\S+)/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($element =~ /Downloading: (\S+)/) 1 43 44
33 1 push(@downloads, $1);
34 }
35 }
36 1 ▶ return wantarray() ? @downloads : scalar(@downloads);
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 1 0 1
37 }
38  
39  
40 3 1;
41  
42 __END__
↑ Summary