blib/lib/Perinci/CmdLine/Plugin/Debug/DumpRes.pm

filter: Statementstmt 62.9% 17 / 27 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 66.6% 4 / 6 Podpod 0.0% 0 / 2 totaltotal 52.5% 21 / 40 CC 3 SCAR 16.6
CC
3
Cov
55%
after_action
12.0
meta
2.0
BEGIN
1.0
CRAP 5.2
« blib/lib/Perinci/CmdLine/Plugin/Debug/DumpR.pm ↑ Summary blib/lib/Perinci/CmdLine/Plugin/Flow/Exit.pm »
1 package Perinci::CmdLine::Plugin::Debug::DumpRes;
2  
3 # put pragmas + Log::ger here
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Log::ger;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use parent 'Perinci::CmdLine::PluginBase';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 # put other modules alphabetically here
10  
11 # put global variables alphabetically here
12 1 our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
13 1 our $DATE = '2023-11-23'; # DATE
14 1 our $DIST = 'Perinci-CmdLine-Lite'; # DIST
15 1 our $VERSION = '1.929'; # VERSION
16  
17 0 ▶sub meta {
Subroutine meta: not called CC=1 SCAR=6.9
Pod undocumented
18 return {
19 0 summary => 'Dump result ($r->{res}), by default after action',
20 conf => {
21 dumper => {
22 schema => ['str*', in=>['Data::Dump::Color', 'Data::Dmp']],
23 default => 'Data::Dump::Color',
24 },
25 },
26 tags => ['category:debugging'],
27 };
28 }
29  
30 0 ▶sub after_action {
Subroutine after_action: not called CC=3 SCAR=24.8
Pod undocumented
31 0 my ($self, $r) = @_;
32  
33 0 ▶ my $dumper = $self->{dumper} || 'Data::Dump::Color';
Condition0%0/2
$self->{'dumper'} || 'Data::Dump::Color'
l!l
00
MC/DC0%0/1
$self->{'dumper'} || 'Data::Dump::Color'
$self->{'dumper'}
Truth table0%0/2
A
A= $self->{'dumper'}
Aresult
11
00
34 0 ▶ if ($dumper eq 'Data::Dmp') {
Branch: 1 branch
BranchTrueFalseTotal
if ($dumper eq 'Data::Dmp') { } 0 0 0
35 0 require Data::Dmp;
36 0 local $Data::Dmp::OPT_DEPARSE = 1;
37 0 Data::Dmp::dd($r->{res});
38 } else {
39 0 require Data::Dump::Color;
40 0 Data::Dump::Color::dd($r->{res});
41 }
42  
43 0 [200, "OK"];
44 }
45  
46 1 1;
47 # ABSTRACT: Dump result ($r->{res}), by default after action
48  
49 __END__
« blib/lib/Perinci/CmdLine/Plugin/Debug/DumpR.pm ↑ Summary blib/lib/Perinci/CmdLine/Plugin/Flow/Exit.pm »