Branch Coverage

blib/lib/Config/Auto.pm
Criterion Covered Total %
branch 160 208 76.9


line true false branch
161 511 1309 if @_
172 12 66 if (my $format = $hash{'format'})
175 0 12 unless $Methods{$format}
182 78 78 defined $hash{$key} ? :
205 32 33 unless (UNIVERSAL::isa($self, 'Config::Auto'))
206 0 32 unless $self = 'Config::Auto'->new('source', $self, @_)
211 0 65 unless defined $file
212 0 65 unless -e $file
220 63 2 unless ($self->format)
221 0 63 if $self->file and -B $self->file and $] >= '5.006'
226 1 6 if exists $$score{'perl'} and $Config::Auto::DisablePerl
229 1 62 unless keys %$score
233 25 37 if (@methods > 1)
235 0 25 if $$score{$methods[0]} == $$score{$methods[1]}
262 27 68 if $self->_score
266 0 68 if $$data[0] =~ /^\s*<\?xml/
267 10 58 if $$data[0] =~ /^#!.*perl/
272 6 286 if /(?:\#|%) # a #YAML or %YAML YAML (?::|\s) # a YAML: or YAML[space] /x and $$data[0] eq $_
276 6 286 if /^---/ and $$data[0] eq $_
277 0 292 if /^\s+-\s\w+:\s\w+/
280 0 292 if /^\s*#\s*\w+\s*=/
281 50 242 if /^\s*#/
286 41 201 unless /\S/
288 48 153 if /^.*=.*$/
289 24 177 if /^\S+\s+=\s+/
290 71 130 if /^[^:]+:[^:=]+/
291 47 154 if /^\s*\w+\s*:[^:]+$/
292 0 201 if /^\s*\w+\s*:=[^:]+$/
293 0 201 if /^\s*\$\w+(\{.*?\})*\s*=.*/
294 28 173 if /^[^\s:]+\s+\S+$/
297 115 86 if /^(\S+)\s+(\S+\s*)+/
298 1 200 if /\s*\S+\s*{$/
299 18 183 if m[^[\w/\-\+]+$]
300 3 198 if /^\s*}\s*$/ and exists $score{'bind'}
301 0 201 if /^\s*};\s*$/ and exists $score{'irssi'}
302 0 201 if /(\s*|^)\w+\s*=\s*{/
303 0 201 if /\b([\@%\$]\w+)/g
304 24 177 if /;\s*$/
305 0 201 if /(if|for|while|until|unless)\s*\(/
307 37 164 if /^\s*\w+\s*=.*$/
308 7 194 if /^\s*\[[\s\w]+\]\s*$/
312 21 37 if (exists $score{'ini'})
314 7 14 $score{'ini'} > $score{'equal'} ? :
320 1 57 if (exists $score{'perl'})
321 1 0 unless "@$data" =~ /;/ > 3 or $#$data < 3
322 0 1 unless "@$data" =~ /;/
323 0 1 unless "@$data" =~ /([\$\@\%]\w+)/
326 1 13 if ($score{'equal'} and $score{'space'} and $score{'equal'} == $score{'space'})
343 23 66 if $self->_data
348 20 46 if (ref $src) { }
23 23 elsif ($src =~ /\n/) { }
380 15 48 if $self->_fh
385 12 36 if (ref $src) { }
12 24 elsif ($src =~ /\n/) { }
402 24 0 if (open $fh, $file) { }
423 156 67 if $self->_file
429 42 25 if (ref $src or $src =~ /\n/) { }
435 20 22 ref $src ? :
441 20 22 if ref $src
444 0 25 unless my $file = $self->_find_file($src, $self->path)
490 24 2 if -e $name
491 1 1 if $try = $self->_chkpaths($path, $name) and -e $try
492 0 1 if -e ($try = catfile($bindir, $name))
493 0 1 if $ENV{'HOME'} and -e ($try = catfile($ENV{'HOME'}, $name))
494 0 1 if -e "/etc/$name"
495 0 1 if -e "/usr/local/etc/$name"
508 0 2 unless defined $paths
511 2 0 ref $paths eq 'ARRAY' ? :
512 1 1 if -e ($file = catfile($path, $filename))
523 0 6 if $Config::Auto::Untaint
526 0 6 if $@
534 1 0 unless (exists $INC{'XML/Simple.pm'})
538 1 0 if $@
549 1 5 unless (exists $INC{'Config/IniFiles.pm'})
553 0 1 if $@
589 30 66 if /^\s*#/
590 12 54 unless /^\s*(.*?)\s*:\s*(.*)/
593 18 36 if ($v =~ /:/) { }
0 36 elsif ($v =~ /, /) { }
6 30 elsif ($v =~ / /) { }
0 30 elsif ($v =~ /,/) { }
613 6 85 if (exists $$c{$k} and not ref $$c{$k})
617 6 85 if (grep /=/, @v) { }
42 43 elsif (@v == 1) { }
622 6 0 if (/(.*)=(.*)/) { }
631 0 6 if (exists $$c{$k} and ref $$c{$k} ne 'HASH') { }
635 0 0 if ref($h = $_) eq 'hash'
637 0 0 if ($h) { }
644 18 24 if (exists $$c{$k}) { }
645 6 12 if (ref $$c{$k} eq 'HASH') { }
649 0 43 if (exists $$c{$k}) { }
650 0 0 if (ref $$c{$k} eq 'HASH') { }
667 19 16 if /^\s*#/
668 1 15 unless /^\s*(.*?)\s*=\s*(.*?)\s*$/
673 0 15 if ($v =~ /,/ and not $v =~ /(["']).*?,.*?\1/) { }
2 13 elsif ($v =~ /\s/) { }
678 2 0 unless $loaded_tp++
697 0 37 if /^\s*#/
698 0 37 unless /\s*(\S+)\s+(.*)/
703 1 36 if ($v =~ /,/ and not $v =~ /(["']).*?,.*?\1/) { }
18 18 elsif ($v =~ /\s/) { }
708 2 16 unless $loaded_tp++
723 0 62 unless my $msg = shift()
725 0 62 if $Config::Auto::Debug