Data/Printer/Filter/REF.pm

filter: Statementstmt 95.4% 21 / 22 Branchbran 75.0% 3 / 4 Conditioncond 83.3% 10 / 12 MC/DCmcdc 50.0% 3 / 6 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 84.0% 42 / 50 CC 7 SCAR 16.0
CC
7
Cov
89%
parse
7.2
BEGIN
1.0
BEGIN
1.0
CRAP 5.0
« Data/Printer/Filter/GLOB.pm ↑ Summary Data/Printer/Filter/Digest.pm »
1 package Data::Printer::Filter::REF;
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 Scalar::Util ();
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 35 filter 'REF' => \&parse;
8  
9 65 ▶sub parse {
Subroutine parse: called CC=7 SCAR=19.8
Pod undocumented
10 65 my ($ref, $ddp) = @_;
11  
12 65 my $string = '';
13 # we only add the '\' if it's not an object
14 65 ▶ if (!Scalar::Util::blessed($$ref) && (ref $$ref eq 'REF' || ref $$ref eq 'SCALAR' || ref $$ref eq 'VSTRING')) {
Branch: 1 branch
BranchTrueFalseTotal
if (not builtin::blessed($$ref) and ref $$ref eq "REF" || ref $$ref eq "SCALAR" || ref $$ref eq "VSTRING") 24 41 65
Condition88%8/9
not builtin::blessed($$ref) and ref $$ref eq "REF" || ref $$ref eq "SCALAR" || ref $$ref eq "VSTRING"
!ll&&!rl&&r
162524
ref $$ref eq "REF" or ref $$ref eq "SCALAR" or ref $$ref eq "VSTRING"
l!l&&r!l&&!r
24025
ref $$ref eq "REF" or ref $$ref eq "SCALAR"
l!l&&r!l&&!r
121225
MC/DC75%3/4
not builtin::blessed($$ref) and ref $$ref eq "REF" || ref $$ref eq "SCALAR" || ref $$ref eq "VSTRING"
not builtin::blessed($$ref) ref $$ref eq "REF" ref $$ref eq "SCALAR" ref $$ref eq "VSTRING"
Truth table80%4/5
not(A) and B or C or D
A= not builtin::blessed($$ref)B= ref $$ref eq "REF"C= ref $$ref eq "SCALAR"D= ref $$ref eq "VSTRING"
ABCDresult
0XXX0
10000
11XX1
101X1
10011
15 24 $string .= '\\ ';
16 }
17 65 $string .= $ddp->parse($$ref);
18  
19 65 ▶ if ($ddp->show_tied and my $tie = ref tied $ref) {
Branch: 1 branch
BranchTrueFalseTotal
if ($ddp->show_tied and my $tie = ref tied $ref) 0 65 65
Condition66%2/3
$ddp->show_tied and my $tie = ref tied $ref
!ll&&!rl&&r
3620
MC/DC0%0/2
$ddp->show_tied and my $tie = ref tied $ref
$ddp->show_tied my $tie = ref tied $ref
Truth table66%2/3
A and B
A= $ddp->show_tiedB= my $tie = ref tied $ref
ABresult
0X0
100
111
20 0 $string .= " (tied to $tie)";
21 }
22  
23 65 return $string;
24 };
25  
26 35 1;
« Data/Printer/Filter/GLOB.pm ↑ Summary Data/Printer/Filter/Digest.pm »