ZofCMS/Plugin/Debug/Dumper.pm

filter: Statementstmt 41.1% 14 / 34 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 66.6% 4 / 6 Podpod 0.0% 0 / 2 totaltotal 32.1% 18 / 56 CC 11 SCAR 45.1
CC
11
Cov
30%
process
132.0
new
2.0
BEGIN
1.0
CRAP 91.1
« ZofCMS/Plugin/Session.pm ↑ Summary ZofCMS/Plugin/FormFiller.pm »
1 package App::ZofCMS::Plugin::Debug::Dumper;
2  
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 our $VERSION = '1.001010'; # VERSION
7  
8 1 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use HTML::Entities (qw/encode_entities/);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 0 ▶sub new { bless {}, shift }
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
12  
13 0 ▶sub process {
Subroutine process: not called CC=11 SCAR=48.8
Pod undocumented
14 0 my ( $self, $template, $query, $config ) = @_;
15  
16 my %conf = (
17 t_prefix => 'dumper_',
18 use_qq => 1,
19 pre => 1,
20 escape_html => 1,
21 line_length => 150,
22 0 ▶ %{ delete $config->conf->{plug_dumper} || {} },
Condition0%0/2
delete $config->conf->{'plug_dumper'} || {}
l!l
00
MC/DC0%0/1
delete $config->conf->{'plug_dumper'} || {}
delete $config->conf->{'plug_dumper'}
Truth table0%0/2
A
A= delete $config->conf->{'plug_dumper'}
Aresult
11
00
23 0 ▶ %{ delete $template->{plug_dumper} || {} },
Condition0%0/2
delete $template->{'plug_dumper'} || {}
l!l
00
MC/DC0%0/1
delete $template->{'plug_dumper'} || {}
delete $template->{'plug_dumper'}
Truth table0%0/2
A
A= delete $template->{'plug_dumper'}
Aresult
11
00
24 );
25  
26 0 ▶ if ( $conf{use_qq} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($conf{"use_qq"}) 0 0 0
27 0 $Data::Dumper::Useqq = 1;
28 }
29  
30 0 my $t_dump = Dumper $template;
31  
32 $template->{t}{ $conf{t_prefix} . 't' . $_ } = Dumper $template->{$_}
33 0 for qw/t d/;
34  
35 0 $template->{t}{ $conf{t_prefix} . 't' } = $t_dump;
36 0 $template->{t}{ $conf{t_prefix} . 'q' } = Dumper $query;
37 0 $template->{t}{ $conf{t_prefix} . 'c' } = Dumper $config->conf;
38  
39 0 ▶ if ( $conf{line_length } ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($conf{"line_length"}) 0 0 0
40 0 for ( qw/tt td t q c/ ) {
41 0 $template->{t}{ $conf{t_prefix} . $_ } =~ s/(.{$conf{line_length}})(?!\n)/$1\n/g;
42 }
43 }
44  
45 0 ▶ if ( $conf{escape_html} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($conf{"escape_html"}) 0 0 0
46 encode_entities $template->{t}{ $conf{t_prefix} . $_ }
47 0 for qw/tt td t q c/;
48 }
49  
50 0 ▶ if ( $conf{pre} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($conf{"pre"}) 0 0 0
51 $template->{t}{ $conf{t_prefix} . $_ }
52 = qq|<pre style="font-family: 'DejaVu Sans Mono', monotype;">|
53 . $template->{t}{ $conf{t_prefix} . $_ } . q|</pre>|
54 0 for qw/tt td t q c/;
55 }
56  
57 0 return 1;
58 }
59  
60 1 1;
61 __END__
« ZofCMS/Plugin/Session.pm ↑ Summary ZofCMS/Plugin/FormFiller.pm »