Branch Coverage

blib/lib/Data/Printer/Config.pm
Criterion Covered Total %
branch 83 114 72.8


line true false branch
8 3 1 unless ($filename)
11 0 4 unless $filename and -e $filename and not -d $filename
12 4 0 if (open my $fh, '<', $filename) { }
27 1 10 if exists $ENV{'DATAPRINTERRC'}
34 1 49 if -f $file
36 0 49 unless @path
38 8 41 if not defined $updir or $updir eq $dir
49 0 10 unless defined $cwd
56 1 9 if ($0 eq '-e' or $0 eq '-') { }
58 1 0 if defined $cwd
62 0 9 unless -f $script
66 9 0 unless "File::Spec"->file_name_is_absolute($script)
69 9 0 if defined $maybe_path
77 3 10 if ($testing) { }
0 10 elsif ($^O eq 'MSWin32' and "$]" < 5.016) { }
0 10 elsif ($^O eq 'MacOS') { }
83 3 0 unless -d $home
91 0 0 unless $error
96 10 0 if $home
99 0 0 if (exists $ENV{'LOGDIR'} and $ENV{'LOGDIR'})
102 0 0 if (not $home and exists $ENV{'HOME'} and $ENV{'HOME'})
106 0 0 unless defined $home
107 0 0 if (defined $home and not -d $home)
116 1 0 unless defined $mode_raw
118 0 0 length $mode == 4 && substr($mode, 2, 2) eq '00' ? :
131 13 170 if (defined $filter) { }
54 116 elsif (/^\s*(?:\#|\;|$)/) { }
18 98 elsif (/^\s*\[\s*(.+?)\s*\]\s*$/) { }
90 8 elsif (/^\s*([^=]+?)\s*=\s*(.*?)\s*$/) { }
7 1 elsif (/^begin\s+filter\s+([^\s]+)\s*$/) { }
132 6 7 if (/^end filter\s*$/) { }
1 6 elsif (/^begin\s+filter/) { }
133 6 0 unless (defined $can_use_filters)
136 5 1 if ($can_use_filters) { }
180 18 72 if (@subpath == 1 and $subpath[0] eq "filters")
185 54 90 if (@subpath > 0) { }
200 1 0 if ($counter == 1 and /\A\s*\{/s)
216 0 24 if exists $config->{$ns}{'profile'}
223 211 614 if (ref $new eq 'HASH') { }
35 579 elsif (ref $new eq 'ARRAY') { }
225 156 55 ref $old eq 'HASH' ? :
228 449 169 if (exists $new->{$k}) { }
256 2 5 if (not $profile =~ /\A[a-zA-Z0-9:]+\z/) { }
263 1 4 if defined $load_error
265 0 4 unless ref $expanded eq "HASH"
268 1 4 if (defined $error)
281 1 3 unless $filename
283 1 2 unless -e $filename and not -d $filename
285 0 2 unless open my $fh, "<", $filename
293 0 2 if ($@) { }
1 1 elsif (not ref $config or ref $config ne 'HASH') { }
306 5 8 if (ref $value eq "HASH")
307 1 4 if $key_str eq "color"
310 7 5 $key_str ? :
314 1 7 if ($key_str and $key_str eq 'filters.-external' and ref $value eq 'ARRAY') { }
2 5 elsif (ref $value) { }
330 1 4 if $value =~ /\s/