Branch Coverage

blib/lib/Data/Dumper/Compact.pm
Criterion Covered Total %
branch 68 120 56.6


line true false branch
13 1 0 unless defined $ddc
14 0 0 unless ($ddc || '') =~ /^[jd]dc$/
45 19 0 if $dd->can('Trailingcomma')
71 0 0 if ref $self and $opts and local(@{$self;}{keys %$opts}) = values %$opts, 1 and $opts->{'indent_by'}
72 37 0 unless ref $self
91 40 293 if (ref $data eq 'HASH') { }
53 240 elsif (ref $data eq 'ARRAY') { }
3 474 elsif (&blessed($data) and my $ret = $self->_expand_blessed($data)) { }
104 207 30 if (my($string) = $thing =~ /^"(.*)"$/)
105 9 198 $string =~ /^-[a-zA-Z]\w*$/ ? :
112 3 0 unless $_ eq 'ARRAY'
0 3 unless grep {$_ eq 'HASH' unless $_ eq 'ARRAY';} &reftype($blessed)
113 0 3 &reftype($blessed) eq 'ARRAY' ? :
119 0 28 unless $tfspec
128 37 263 if ($type eq 'hash') { }
50 213 elsif ($type eq 'array') { }
146 0 0 if (ref $tf eq 'ARRAY') { }
0 0 elsif (ref $tf eq 'HASH') { }
149 0 0 if @match > @$path
151 0 0 unless defined(my $m = $match[$idx])
153 0 0 if (not ref $m) { }
0 0 elsif (ref $m eq 'Regexp') { }
0 0 elsif (ref $m eq 'CODE') { }
154 0 0 unless $rpv eq $m
156 0 0 unless $rpv =~ /$m/
159 0 0 unless &$m($rpv)
165 0 0 unless $tf = $tf->{$type} || $tf->{'_'}
169 0 0 unless $self->$tf($type, $payload, $path)
192 0 1048 if (not $self->{'vertical'} and $self->width <= 0)
205 0 0 if (@plain == @$payload)
207 0 0 if $self->{'oneline'} or length $try <= $self->width
219 30 370 if $el->[0] eq 'key'
225 0 168 if ($self->{'vertical'})
230 0 168 unless my(@pl) = @$payload
240 166 2 unless (grep /\n/, @oneline)
242 124 42 if $self->{'oneline'} or length $try <= $self->width
245 12 32 if (@$payload == 1)
249 3 29 if (@$payload == 2 and $payload->[0][0] eq 'key')
255 3 0 $s =~ /\A(.{0,${\$self->width;}})(?:\n|\Z)/ ? :
267 187 0 unless ($f =~ /\n/)
270 107 80 if (length $f <= $spare)
274 65 15 if (length $f <= $self->width)
285 15 0 if ($spare > 0 and $f =~ s/^(.{0,$spare})\n//ms)
288 15 0 if @bits
292 15 0 if ($f =~ s/(?:\A|\n)(.{0,${\$self->width;}})\Z//ms)
296 15 0 if length $f
298 29 0 if @bits
307 244 17 $key =~ /^-?[a-zA-Z_]\w*$/ ? :
317 0 185 unless @$keys
321 0 185 if ($self->{'vertical'})
332 154 31 if $self->{'oneline'}
333 4 27 if not $oneline =~ /\n/ and length $oneline <= $self->width
339 40 7 $s =~ /\A(.{0,$width})(?:\n|\Z)/ ? :
345 15 12 if (@f == 1)
359 8 482 $str =~ /[\\']/ ? :
360 0 490 $self->{'vertical'} ? :
361 486 4 if length $str <= $w
375 4 26 unless @lines
377 20 6 $lines[-1] =~ /^[\}\]\)]/ ? :
379 12 14 $l eq '{' ? :