Syndication/Util.pm

filter: Statementstmt 100% 20 / 20 Branchbran 50.0% 1 / 2 Conditioncond 66.6% 4 / 6 MC/DCmcdc 50.0% 2 / 4 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 2 totaltotal 82.0% 32 / 39 CC 4 SCAR 7.5
CC
4
Cov
89%
utf8_off
3.3
nodelist
2.0
BEGIN
1.0
CRAP 2.1
« Syndication/Feed.pm ↑ Summary Syndication/Source.pm »
1 package XML::Atom::Syndication::Util;
2 22 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 22 ▶use vars qw( @EXPORT_OK );
Subroutine BEGIN: called CC=1 SCAR=0.0
5 22 @EXPORT_OK = qw( utf8_off nodelist );
6  
7 22 ▶use base qw( Exporter );
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 111 ▶sub utf8_off {
Subroutine utf8_off: called CC=3 SCAR=12.0
Pod undocumented
10 111 ▶ if ($] > 5.008 && defined $_[0]) {
Branch: 1 branch
BranchTrueFalseTotal
if ($] > "5.008" and defined $_[0]) 111 0 111
Condition33%1/3
$] > "5.008" and defined $_[0]
!ll&&!rl&&r
00111
MC/DC0%0/2
$] > "5.008" and defined $_[0]
$] > "5.008" defined $_[0]
Truth table33%1/3
A and B
A= $] > "5.008"B= defined $_[0]
ABresult
0X0
100
111
11 111 require Encode;
12 111 Encode::_utf8_off($_[0]);
13 }
14 111 $_[0];
15 }
16  
17 234 ▶sub nodelist {
Subroutine nodelist: called CC=2 SCAR=6.9
Pod undocumented
18 234 my ($node, $ns, $name) = @_;
19 my @nodes =
20 808 ▶ grep { ref($_) eq 'XML::Elemental::Element' && $_->name eq "{$ns}$name" }
Condition100%3/3
ref $_ eq 'XML::Elemental::Element' && $_->name eq "{$ns}$name"
!ll&&!rl&&r
465100243
MC/DC100%2/2
ref $_ eq 'XML::Elemental::Element' && $_->name eq "{$ns}$name"
ref $_ eq 'XML::Elemental::Element' $_->name eq "{$ns}$name"
Truth table100%3/3
A && B
A= ref $_ eq 'XML::Elemental::Element'B= $_->name eq "{$ns}$name"
ABresult
0X0
100
111
21 234 @{$node->elem->contents};
22 234 @nodes;
23 }
24  
25 22 1;
« Syndication/Feed.pm ↑ Summary Syndication/Source.pm »