Branch Coverage

blib/lib/Config/Scoped.pm
Criterion Covered Total %
branch 130 186 69.8


line true false branch
38 1 50 if @_ % 2
53 0 50 unless my $thisparser = $class->SUPER::new($empty_grammar)
75 14 36 if (my $cfg_file = $$thisparser{'local'}{'file'}) { }
77 1 13 if ref $cfg_file
82 0 13 unless my(undef, $cfg_dir) = fileparse($cfg_file)
89 0 13 unless $cfg_file = 'File::Spec'->rel2abs($cfg_file)
112 34 15 unless $$thisparser{'local'}{'warnings'}
116 2 47 if (ref $$thisparser{'local'}{'warnings'} ne 'HASH')
117 0 2 if $$thisparser{'local'}{'warnings'} =~ /on/i
119 2 0 if $$thisparser{'local'}{'warnings'} =~ /off/i
140 1 240 unless ref $$thisparser{'local'}{$hash_name} eq 'HASH'
147 7 41 if ($$thisparser{'local'}{'safe'}) { }
148 1 6 unless UNIVERSAL::can($$thisparser{'local'}{'safe'}, 'reval')
154 0 41 unless $$thisparser{'local'}{'safe'} = 'Safe'->new
165 1 45 if @_ % 2
169 44 1 unless (defined $$thisparser{'local'}{'compiled'})
178 14 31 unless (defined $cfg_text)
179 0 14 unless my $cfg_file = $$thisparser{'local'}{'cfg_file'}
186 1 13 if $cfg_file eq '_STRING'
192 1 11 unless $cfg_text
202 1 10 if $$thisparser{'local'}{'includes'}{$digest}
227 13 24 if (not @declarations and %$params) { }
244 0 224 if @_ % 2
250 0 224 unless defined $args{'name'}
259 81 143 if exists $$warnings{$name} and $$warnings{$name} eq 'off'
260 3 140 if exists $$warnings{$name} and $$warnings{$name} eq 'on'
263 6 134 if exists $$warnings{'all'} and $$warnings{'all'} eq 'off'
264 105 29 if exists $$warnings{'all'} and $$warnings{'all'} eq 'on'
273 0 64 if @_ % 2
279 0 64 unless defined $args{'switch'}
292 38 26 if ($name eq 'all') { }
320 35 253 if $name =~ /^decl/i
321 160 93 if $name =~ /^param/i
322 11 82 if $name =~ /^mac/i
323 34 48 if $name =~ /^perm/i
324 2 46 if $name =~ /^dig/i
331 0 1 if @_ % 2
339 1 0 unless ($cache_file)
340 0 1 unless my $cfg_file = $$thisparser{'local'}{'cfg_file'}
344 0 1 if $cfg_file eq '_STRING'
358 0 1 if $@
360 0 1 unless $result
368 0 1 if @_ % 2
377 1 0 unless ($cache_file)
378 0 1 unless my $cfg_file = $$thisparser{'local'}{'cfg_file'}
382 0 1 if $cfg_file eq '_STRING'
390 0 1 unless -r $cache_file
395 0 1 unless $thisparser->permissions_validate(%args, 'file', $cache_file)
403 0 1 if $@
405 0 1 unless $cfg_cache
410 0 1 unless $thisparser->warnings_on(%args, 'name', 'digests')
418 0 2 if ($digest ne md5_base64($text))
453 0 6 unless defined $args{'file'}
465 6 0 unless ('File::Spec'->file_name_is_absolute($include_file))
466 0 6 unless $include_file = 'File::Spec'->catfile($parent_cfg_dir, $include_file)
481 0 6 unless my $clone_parser = ref($thisparser)->new(%{$$thisparser{'local'};}, 'file', $include_file)
502 0 10 unless defined $args{'name'} and defined $args{'value'}
516 0 10 unless defined $args{'name'} and defined $args{'value'}
524 9 1 if ($thisparser->warnings_on('name', 'macro'))
525 0 9 if exists $$thisparser{'local'}{'macros'}{$name}
542 0 93 unless defined $args{'value'}
553 93 0 defined $value ? :
561 0 152 unless defined $args{'value'} and defined $args{'name'}
565 2 150 if $$thisparser{'local'}{'lc'}
578 0 152 unless defined $args{'value'} and defined $args{'name'}
583 89 63 if ($thisparser->warnings_on('name', 'parameter'))
584 1 88 if exists $$thisparser{'local'}{'params'}{$args{'name'}}
601 0 34 unless defined $args{'name'} and defined $args{'value'}
607 1 33 if $$thisparser{'local'}{'lc'}
618 39 5 unless exists $$tail{$name}
637 0 34 unless defined $args{'name'} and defined $args{'value'}
642 33 1 if ($thisparser->warnings_on('name', 'declaration'))
648 0 33 if %{$args{'tail'};}
659 0 16 unless defined $args{'handle'} or defined $args{'file'}
666 15 1 unless $thisparser->warnings_on('name', 'permissions', 'warnings', $warnings)
675 0 1 unless stat $fh
685 1 0 if $uid != 0 and $uid != $<
692 0 0 if $mode & 18
708 0 84 unless defined $args{'value'}
725 69 15 unless ($quote_name)
726 28 41 if $quote_delim eq '"'
727 41 28 if $quote_delim eq q[']
731 0 84 unless $accept{$quote_name}
738 38 46 unless $quote_name eq 'single' or $quote_delim eq q[']
742 38 46 unless $quote_name eq 'single' or $quote_delim eq q[']
746 84 0 defined $quote_text ? :
754 0 15 unless defined $args{'file'}
762 0 15 unless open CFG, $cfg_file
770 0 14 unless $thisparser->permissions_validate(%args, 'handle', \*CFG)
780 0 14 unless close CFG
795 0 55 unless defined $args{'expr'}
810 0 55 if (not defined $result and $@)
822 0 55 defined $result ? :