blib/lib/Data/TreeDumper/OO.pm

filter: Statementstmt 33.7% 31 / 92 Branchbran 16.6% 1 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 26.4% 9 / 34 Podpod 0.0% 0 / 29 totaltotal 25.4% 41 / 161 CC 5 SCAR 8.8
CC
5
Cov
33%
DumpMany
6.0
SetFilter
6.0
SetLevelFilters
6.0
CRAP 2.4
↑ Summary
1 package Data::TreeDumper::OO;
2 1 $Data::TreeDumper::OO::VERSION = '0.10';
3 1 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
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 Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 require Exporter;
9  
10 1 our @ISA = qw(Exporter);
11 1 our %EXPORT_TAGS = ( 'all' => [ qw() ] );
12 1 our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
13 1 our @EXPORT = qw();
14  
15 1 ▶use Data::TreeDumper 0.24 ;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 #----------------------------------------------------------------------------------------------------
18  
19 sub new
20 1 ▶{
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
21 1 my($class, %setup_data) = @_;
22  
23 1 return bless({%Data::TreeDumper::setup, %setup_data}, $class);
24 }
25  
26 #------------------------------------------------------------------------------------------
27 sub Dump
28 1 ▶{
Subroutine Dump: called CC=2 SCAR=7.1
Pod undocumented
29 1 my($self, $structure_to_dump, $title, %overrides) = @_;
30  
31 1 ▶$title = defined $title ? $title : '' ;
Branch: 1 branch
BranchTrueFalseTotal
defined $title ? : 1 0 1
32  
33 return
34 (
35 Data::TreeDumper::TreeDumper
36 (
37 $structure_to_dump
38 , {
39 TITLE => $title
40 , FILTER => $self->{FILTER}
41 , LEVEL_FILTERS => $self->{LEVEL_FILTERS}
42 , START_LEVEL => $self->{START_LEVEL}
43 , USE_ASCII => $self->{USE_ASCII}
44 , MAX_DEPTH => $self->{MAX_DEPTH}
45 , INDENTATION => $self->{INDENTATION}
46 , VIRTUAL_WIDTH => $self->{VIRTUAL_WIDTH}
47 , DISPLAY_OBJECT_TYPE => $self->{DISPLAY_OBJECT_TYPE}
48 , DISPLAY_INHERITANCE => $self->{DISPLAY_INHERITANCE}
49 , DISPLAY_AUTOLOAD => $self->{DISPLAY_AUTOLOAD}
50 , DISPLAY_TIE => $self->{DISPLAY_TIE}
51 , DISPLAY_ADDRESS => $self->{DISPLAY_ADDRESS}
52 , DISPLAY_ROOT_ADDRESS => $self->{DISPLAY_ROOT_ADDRESS}
53 , DISPLAY_PERL_ADDRESS => $self->{DISPLAY_PERL_ADDRESS}
54 , DISPLAY_PERL_SIZE => $self->{DISPLAY_PERL_SIZE}
55 , NUMBER_LEVELS => $self->{NUMBER_LEVELS}
56 , COLOR_LEVELS => $self->{COLOR_LEVELS}
57 , NO_OUTPUT => $self->{NO_OUTPUT}
58 , RENDERER => $self->{RENDERER}
59 , GLYPHS => $self->{GLYPHS}
60 , NO_NO_ELEMENTS => $self->{NO_NO_ELEMENTS}
61 , QUOTE_HASH_KEYS => $self->{QUOTE_HASH_KEYS}
62 , QUOTE_VALUES => $self->{QUOTE_VALUES}
63 , REPLACEMENT_LIST => $self->{REPLACEMENT_LIST}
64 , DISPLAY_PATH => $self->{DISPLAY_PATH}
65
66 , __DATA_PATH => $self->{__DATA_PATH}
67 , __TYPE_SEPARATORS => $self->{__TYPE_SEPARATORS}
68
69 1 , %overrides
70 }
71 )
72 ) ;
73 }
74  
75 #------------------------------------------------------------------------------------------
76  
77 sub DumpMany
78 0 ▶{
Subroutine DumpMany: not called CC=2 SCAR=17.9
Pod undocumented
79 0 my $self = shift ;
80  
81 0 my @trees = grep {'ARRAY' eq ref $_} @_ ;
82 0 my %global_override = grep {'ARRAY' ne ref $_} @_ ;
83  
84 0 my $dump = '' ;
85  
86 0 for my $tree (@trees)
87 {
88 0 my ($structure_to_dump, $title, %override) = @{$tree} ;
89
90 0 $dump .= $self->Dump($structure_to_dump, $title, %global_override, %override) ;
91 }
92  
93 0 return($dump) ;
94 }
95  
96 #------------------------------------------------------------------------------------------
97 sub SetFilter
98 0 ▶{
Subroutine SetFilter: not called CC=2 SCAR=17.9
Pod undocumented
99 0 my($self, $filter) = @_;
100  
101 0 ▶croak "Filter must be a code reference!" unless ('CODE' eq ref $filter) ;
Branch: 1 branch
BranchTrueFalseTotal
unless "CODE" eq ref $filter 0 0 0
102  
103 0 $self->{FILTER} = $filter ;
104 }
105  
106 #------------------------------------------------------------------------------------------
107 sub SetLevelFilters
108 0 ▶{
Subroutine SetLevelFilters: not called CC=2 SCAR=17.9
Pod undocumented
109 0 my($self, $filters) = @_;
110  
111 0 ▶croak "Filter must be an array reference!" unless ('ARRAY' eq ref $filters) ;
Branch: 1 branch
BranchTrueFalseTotal
unless "ARRAY" eq ref $filters 0 0 0
112  
113 0 $self->{LEVEL_FILTERS} = $filters ;
114 }
115  
116 #------------------------------------------------------------------------------------------
117 sub SetStartLevel
118 0 ▶{
Subroutine SetStartLevel: not called CC=1 SCAR=6.9
Pod undocumented
119 0 my($self, $start_level) = @_ ;
120 0 $self->{START_LEVEL} = $start_level;
121 }
122  
123 #------------------------------------------------------------------------------------------
124 sub NoOutput
125 0 ▶{
Subroutine NoOutput: not called CC=1 SCAR=6.9
Pod undocumented
126 0 my($self, $no_output) = @_ ;
127 0 $self->{NO_OUTPUT} = $no_output ;
128 }
129  
130 #------------------------------------------------------------------------------------------
131 sub UseAscii
132 0 ▶{
Subroutine UseAscii: not called CC=1 SCAR=6.9
Pod undocumented
133 0 my($self, $use_ascii) = @_ ;
134 0 $self->{USE_ASCII} = $use_ascii ;
135 }
136  
137 #------------------------------------------------------------------------------------------
138 sub UseAnsi
139 1 ▶{
Subroutine UseAnsi: called CC=1 SCAR=0.0
Pod undocumented
140 1 my($self, $use_ansi) = @_ ;
141 1 $self->{USE_ASCII} = (!$use_ansi) ;
142 }
143  
144 #------------------------------------------------------------------------------------------
145 sub SetMaxDepth
146 1 ▶{
Subroutine SetMaxDepth: called CC=1 SCAR=0.0
Pod undocumented
147 1 my($self, $max_depth) = @_ ;
148 1 $self->{MAX_DEPTH} = $max_depth ;
149 }
150  
151 #------------------------------------------------------------------------------------------
152 sub SetIndentation
153 0 ▶{
Subroutine SetIndentation: not called CC=1 SCAR=6.9
Pod undocumented
154 0 my($self, $indentation) = @_ ;
155 0 $self->{INDENTATION} = $indentation ;
156 }
157  
158 #------------------------------------------------------------------------------------------
159 sub ReplacementList
160 0 ▶{
Subroutine ReplacementList: not called CC=1 SCAR=6.9
Pod undocumented
161 0 my($self, $replacement) = @_ ;
162 0 $self->{REPLACEMENT_LIST} = $replacement ;
163 }
164  
165 #------------------------------------------------------------------------------------------
166 sub QuoteHashKeys
167 0 ▶{
Subroutine QuoteHashKeys: not called CC=1 SCAR=6.9
Pod undocumented
168 0 my($self, $quote) = @_ ;
169 0 $self->{QUOTE_HASH_KEYS} = $quote ;
170 }
171  
172 #------------------------------------------------------------------------------------------
173 sub QuoteValues
174 0 ▶{
Subroutine QuoteValues: not called CC=1 SCAR=6.9
Pod undocumented
175 0 my($self, $quote) = @_ ;
176 0 $self->{QUOTE_VALUES} = $quote ;
177 }
178  
179 #------------------------------------------------------------------------------------------
180 sub DisplayNoElements
181 0 ▶{
Subroutine DisplayNoElements: not called CC=1 SCAR=6.9
Pod undocumented
182 0 my($self, $no_no_elements) = @_ ;
183 0 $self->{NO_NO_ELEMENTS} = ! $no_no_elements;
184 }
185  
186 #------------------------------------------------------------------------------------------
187 sub SetVirtualWidth
188 0 ▶{
Subroutine SetVirtualWidth: not called CC=1 SCAR=6.9
Pod undocumented
189 0 my($self, $width) = @_ ;
190 0 $self->{VIRTUAL_WIDTH} = $width ;
191 }
192  
193 #------------------------------------------------------------------------------------------
194 sub DisplayRootAddress
195 0 ▶{
Subroutine DisplayRootAddress: not called CC=1 SCAR=6.9
Pod undocumented
196 0 my($self, $display_root_address) = @_ ;
197 0 $self->{DISPLAY_ROOT_ADDRESS} = $display_root_address ;
198 }
199  
200 #------------------------------------------------------------------------------------------
201 sub DisplayAddress
202 0 ▶{
Subroutine DisplayAddress: not called CC=1 SCAR=6.9
Pod undocumented
203 0 my($self, $display_address) = @_ ;
204 0 $self->{DISPLAY_ADDRESS} = $display_address ;
205 }
206  
207 #------------------------------------------------------------------------------------------
208 sub DisplayPath
209 0 ▶{
Subroutine DisplayPath: not called CC=1 SCAR=6.9
Pod undocumented
210 0 my($self, $display_path) = @_ ;
211 0 $self->{DISPLAY_PATH} = $display_path;
212 }
213  
214 #------------------------------------------------------------------------------------------
215 sub DisplayObjectType
216 0 ▶{
Subroutine DisplayObjectType: not called CC=1 SCAR=6.9
Pod undocumented
217 0 my($self, $display_object_type) = @_ ;
218 0 $self->{DISPLAY_OBJECT_TYPE} = $display_object_type ;
219 }
220  
221 #------------------------------------------------------------------------------------------
222 sub DisplayInheritance
223 0 ▶{
Subroutine DisplayInheritance: not called CC=1 SCAR=6.9
Pod undocumented
224 0 my($self, $display_inheritance) = @_ ;
225 0 $self->{DISPLAY_INHERITANCE} = $display_inheritance ;
226 }
227  
228 #------------------------------------------------------------------------------------------
229 sub DisplayAutoload
230 0 ▶{
Subroutine DisplayAutoload: not called CC=1 SCAR=6.9
Pod undocumented
231 0 my($self, $display_autoload) = @_ ;
232 0 $self->{DISPLAY_AUTOLOAD} = $display_autoload ;
233 }
234  
235 #------------------------------------------------------------------------------------------
236 sub Displaytie
237 0 ▶{
Subroutine Displaytie: not called CC=1 SCAR=6.9
Pod undocumented
238 0 my($self, $display_tie) = @_ ;
239 0 $self->{DISPLAY_TIE} = $display_tie ;
240 }
241  
242 #------------------------------------------------------------------------------------------
243 sub DisplayPerlSize
244 0 ▶{
Subroutine DisplayPerlSize: not called CC=1 SCAR=6.9
Pod undocumented
245 0 my($self, $display_perl_size) = @_ ;
246 0 $self->{DISPLAY_PERL_SIZE} = $display_perl_size;
247 }
248  
249 #------------------------------------------------------------------------------------------
250 sub DisplayPerlAddress
251 0 ▶{
Subroutine DisplayPerlAddress: not called CC=1 SCAR=6.9
Pod undocumented
252 0 my($self, $display_perl_address) = @_ ;
253 0 $self->{DISPLAY_PERL_ADDRESS} = $display_perl_address ;
254 }
255  
256 #------------------------------------------------------------------------------------------
257 sub NumberLevels
258 0 ▶{
Subroutine NumberLevels: not called CC=1 SCAR=6.9
Pod undocumented
259 0 my($self, $number_levels) = @_ ;
260 0 $self->{NUMBER_LEVELS} = $number_levels;
261 }
262  
263 #------------------------------------------------------------------------------------------
264 sub ColorLevels
265 0 ▶{
Subroutine ColorLevels: not called CC=1 SCAR=6.9
Pod undocumented
266 0 my($self, $color_levels) = @_ ;
267 0 $self->{COLOR_LEVELS} = $color_levels ;
268 }
269  
270 #------------------------------------------------------------------------------------------
271 sub SetGlyphs
272 0 ▶{
Subroutine SetGlyphs: not called CC=1 SCAR=6.9
Pod undocumented
273 0 my($self, $glyphs) = @_ ;
274 0 $self->{GLYPHS} = $glyphs ;
275 }
276  
277 #------------------------------------------------------------------------------------------
278 sub SetRenderer
279 0 ▶{
Subroutine SetRenderer: not called CC=1 SCAR=6.9
Pod undocumented
280 0 my($self, $renderer) = @_ ;
281 0 $self->{RENDERER} = $renderer ;
282 }
283  
284 #------------------------------------------------------------------------------------------
285  
286 1 1 ;
287  
288 __END__
↑ Summary