blib/lib/Devel/ebug/Backend/Plugin/Pad.pm

filter: Statementstmt 92.5% 25 / 27 Branchbran 50.0% 2 / 4 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 77.2% 34 / 44 CC 5 SCAR 12.2
CC
5
Cov
82%
pad
5.8
BEGIN
1.0
BEGIN
1.0
CRAP 3.4
« blib/lib/Devel/ebug/Backend/Plugin/Run.pm ↑ Summary blib/lib/Devel/ebug/Backend/Plugin/Basic.pm »
1 package Devel::ebug::Backend::Plugin::Pad;
2  
3 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 6 ▶use PadWalker;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 6 our $VERSION = '0.69'; # VERSION
8  
9 6 ▶sub register_commands {
Subroutine register_commands: called CC=1 SCAR=0.0
Pod undocumented
10 6 return ( pad => { sub => \&DB::pad } )
11 }
12  
13 package DB;
14  
15  
16 6 ▶use Scalar::Util qw(blessed reftype);
Subroutine BEGIN: called CC=1 SCAR=0.0
17 2 ▶sub pad {
Subroutine pad: called CC=5 SCAR=17.6
Pod undocumented
18 2 my($req, $context) = @_;
19 2 my $pad;
20 2 my $h = eval { PadWalker::peek_my(2) };
21 2 foreach my $k (sort keys %$h) {
22 4 ▶ if ($k =~ /^@/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($k =~ /^@/) { } 0 4 4
23 0 my @v = eval "package $context->{package}; ($k)"; ## no critic (BuiltinFunctions::ProhibitStringyEval)
24 0 $pad->{$k} = \@v;
25 } else {
26 4 my $v = eval "package $context->{package}; $k"; ## no critic (BuiltinFunctions::ProhibitStringyEval)
27 4 $pad->{$k} = $v;
28  
29 # workaround for blessed globs
30 4 ▶ $pad->{$k} = "".$v if blessed $v and reftype $v eq "GLOB";
Branch: 1 branch
BranchTrueFalseTotal
if builtin::blessed($v) and builtin::reftype($v) eq "GLOB" 0 4 4
Condition33%1/3
builtin::blessed($v) and builtin::reftype($v) eq "GLOB"
!ll&&!rl&&r
400
MC/DC0%0/2
builtin::blessed($v) and builtin::reftype($v) eq "GLOB"
builtin::blessed($v) builtin::reftype($v) eq "GLOB"
Truth table33%1/3
A and B
A= builtin::blessed($v)B= builtin::reftype($v) eq "GLOB"
ABresult
0X0
100
111
31 }
32 }
33 2 return { pad => $pad };
34 }
35  
36  
37 6 1;
38  
39 __END__
« blib/lib/Devel/ebug/Backend/Plugin/Run.pm ↑ Summary blib/lib/Devel/ebug/Backend/Plugin/Basic.pm »