blib/lib/WWW/Mechanize/DecodedContent.pm

filter: Statementstmt 61.1% 11 / 18 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 1 totaltotal 41.1% 14 / 34 CC 5 SCAR 29.5
CC
5
Cov
41%
decoded_content
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 19.1
↑ Summary
1 package WWW::Mechanize::DecodedContent;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 our $VERSION = '0.02';
5  
6 2 ▶use Encode ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use HTTP::Response::Encoding;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 0 ▶sub WWW::Mechanize::decoded_content {
Subroutine decoded_content: not called CC=5 SCAR=34.0
Pod undocumented
10 0 my $mech = shift;
11 0 my $content = $mech->content(@_);
12 0 ▶ return $content unless $mech->{ct} && $mech->{ct} =~ m!^text/!i;
Branch: 1 branch
BranchTrueFalseTotal
unless $mech->{"ct"} and $mech->{"ct"} =~ m[^text/]i 0 0 0
Condition0%0/3
$mech->{"ct"} and $mech->{"ct"} =~ m[^text/]i
!ll&&!rl&&r
000
MC/DC0%0/2
$mech->{"ct"} and $mech->{"ct"} =~ m[^text/]i
$mech->{"ct"} $mech->{"ct"} =~ m[^text/]i
Truth table0%0/3
A and B
A= $mech->{"ct"}B= $mech->{"ct"} =~ m[^text/]i
ABresult
0X0
100
111
13  
14 ## WWW::Mechanize 1.50 or over calls decoded_content() to get page
15 0 ▶ return $content if Encode::is_utf8($content);
Branch: 1 branch
BranchTrueFalseTotal
if &Encode::is_utf8($content) 0 0 0
16  
17 0 ▶ if (my $enc = $mech->res->encoding) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $enc = $mech->res->encoding) { } 0 0 0
18 0 return Encode::decode($enc, $content);
19 } else {
20 0 return;
21 }
22 }
23  
24 2 1;
25 __END__
↑ Summary