Data/Printer/Filter/VSTRING.pm

filter: Statementstmt 95.6% 22 / 23 Branchbran 50.0% 2 / 4 Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 82.0% 32 / 39 CC 4 SCAR 8.9
CC
4
Cov
87%
parse
4.2
BEGIN
1.0
BEGIN
1.0
CRAP 2.4
« Data/Printer/Profile/Dumper.pm ↑ Summary Data/Printer/Filter.pm »
1 package Data::Printer::Filter::VSTRING;
2 35 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 35 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 35 ▶use Data::Printer::Filter;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 35 ▶use Data::Printer::Common;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 35 filter 'VSTRING' => \&parse;
8  
9 3 ▶sub parse {
Subroutine parse: called CC=4 SCAR=14.5
Pod undocumented
10 3 my ($vstring, $ddp) = @_;
11 3 my $string = '';
12  
13 # The reason we don't simply do:
14 # use version 0.77 ();
15 # is because it was causing some issues with UNIVERSAL on Perl 5.8 and
16 # some versions of version.pm. So now we do it on runtime on the filter.
17 # ->parse() will raise an error unless version.pm >= 0.77.
18 3 ▶ my $error = Data::Printer::Common::_tryme(sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
19 3 require version;
20 3 $string = version->parse($$vstring)->normal;
21 3 });
22 3 ▶ $string = 'VSTRING object (unable to parse)' if $error;
Branch: 1 branch
BranchTrueFalseTotal
if $error 0 3 3
23  
24 3 ▶ if ($ddp->show_tied and my $tie = ref tied $$vstring) {
Branch: 1 branch
BranchTrueFalseTotal
if ($ddp->show_tied and my $tie = ref tied $$vstring) 0 3 3
Condition66%2/3
$ddp->show_tied and my $tie = ref tied $$vstring
!ll&&!rl&&r
210
MC/DC0%0/2
$ddp->show_tied and my $tie = ref tied $$vstring
$ddp->show_tied my $tie = ref tied $$vstring
Truth table66%2/3
A and B
A= $ddp->show_tiedB= my $tie = ref tied $$vstring
ABresult
0X0
100
111
25 0 $string .= " (tied to $tie)";
26 }
27 3 return $ddp->maybe_colorize($string, 'vstring');
28 };
29  
30 35 1;
« Data/Printer/Profile/Dumper.pm ↑ Summary Data/Printer/Filter.pm »