Branch Coverage

lib/ChordPro/Config.pm
Criterion Covered Total %
branch 161 318 50.6


line true false branch
44 89 119 unless ($opts)
53 9 110 if (keys %$opts)
61 0 119 if $verbose > 1
67 119 0 if @cfg > 1
77 348 9 if $$main::options{"no$c"}
78 2 7 if (ref $main::options->{$c} eq 'ARRAY') { }
82 0 7 if $verbose
89 0 249 if ($a and $cfg[$a]{'_src'} eq $cfg[$a - 1]{'_src'})
90 0 0 if ($a == $#cfg)
99 0 249 if $verbose
104 0 119 if $verbose > 1
107 0 119 if ($main::options->{'reference'}) { }
120 119 238 if exists $cfg->{'pdf'}{'formats'}{'first'}{$_}
132 0 130 if (exists $ps->{'diagramscolumn'})
137 0 130 if (exists $ps->{'formats'}{'default'}{'toc-title'})
145 0 130 if ($ps->{'songbook'} and is_hashref($ps->{'songbook'}) and %{$ps->{'songbook'};}) { }
151 0 0 if $ps->{$_}
154 0 0 if defined $ps->{'even-odd-songs'} and $ps->{'even-odd-songs'} <= 0
156 0 0 if defined $ps->{'pagealign-songs'} and $ps->{'pagealign-songs'} != 1
157 0 0 if (@depr)
189 238 119 if ($cfg->{'pdf'}{'formats'}{'first'}{$format} // 1) eq ""
194 2023 833 unless defined $t
195 0 833 unless $t
197 0 833 unless is_arrayref($t)
199 833 0 unless is_arrayref($t->[0])
201 0 833 if @$_ and @$_ != 3
210 119 0 if ($cfg->{'pdf'}{'fontdir'}) { }
212 119 0 if (ref $cfg->{'pdf'}{'fontdir'} eq 'ARRAY') { }
219 0 119 $^O =~ /^MS*/u ? :
243 3094 2618 unless defined $cfg->{'pdf'}{'fonts'}{$ff}{$_}
247 0 119 if (defined $main::options->{'diagrams'}) { }
0 119 elsif (defined $main::options->{'user-chord-grids'}) { }
0 119 elsif (defined $main::options->{'chord-grids'}) { }
250 0 0 unless $main::options->{'diagrams'} =~ /^(all|none|user)$/iu
255 0 0 $main::options->{'user-chord-grids'} ? :
259 0 0 $main::options->{'chord-grids'} ? :
263 577 18 unless defined $main::options->{$_}
268 351 6 unless defined $main::options->{$_}
272 0 119 if (defined $main::options->{'chord-grids-sorted'})
279 0 119 if $main::options->{'cfg-print'}
282 8 111 if $backend_configurator
287 0 119 if ($main::options->{'verbose'} > 1)
291 0 0 $v eq $cp ? :
302 0 132 unless defined $file
304 0 132 if $verbose > 1
307 132 0 if ($file =~ /\.json$/iu) { }
0 0 elsif ($file =~ /\.prp$/iu) { }
308 132 0 if (my $lines = fs_load($file, {'split', 1, 'fail', 'soft'})) { }
318 0 0 if (fs_test('efr', $file)) { }
343 119 0 if (not $c =~ m[[/.]]u) { }
0 0 elsif ($dir ne '' and not fn_is_absolute($c)) { }
366 0 219 if $verbose > 1
368 208 11 if ($cfg->{'tuning'})
371 0 208 if $res
379 208 11 if ($cfg->{'chords'})
382 0 208 if (@$c and $c->[0] eq "append")
389 0 49742 if $res
391 0 208 if ($verbose > 1)
406 260 210 unless exists $cfg->{'pdf'}{'fonts'}
408 5 2501 if ref $cfg->{'pdf'}{'fonts'}{$f} eq "HASH"
417 624 0 if ($k =~ /^(colou?r|background|frame|numbercolou?r|size)$/u) { }
428 2501 0 if ($v =~ /(.*?)(?:\s+(\d+(?:\.\d+)?))?\s*(?:;|$)/u)
429 2293 208 if $2
434 1 2500 if ($v =~ /^.*\.(ttf|otf)$/iu) { }
2081 419 elsif (is_corefont($v)) { }
444 211 208 if $i->{'size'}
457 297 260 if ($cfg->{'pdf'}{'fontconfig'})
465 624 2019 if (@k > 1)
479 0 1 unless $cfg->{'pdf'}{'fonts'}
483 1 4 unless is_hashref($_)
486 0 4 if $_->{'color'} and $_->{'color'} eq "foreground"
488 0 4 if $_->{'background'} and $_->{'background'} eq "background"
490 1 3 if (exists $_->{'file'}) { }
2 1 elsif (exists $_->{'description'}) { }
1 0 elsif (exists $_->{'name'} and exists $_->{'size'} and keys %$_ == 2) { }
496 1 1 if ($_->{'size'} and not $_->{'description'} =~ /\s+[\d.]+$/u)
500 2 0 if keys %$_ == 1
518 0 498 if $ps->{$_}
521 246 3 unless defined $_
523 1 2 if $_ < 0
526 245 4 unless defined $_
531 249 0 unless defined $_
537 0 0 if ($_ eq 'title') { }
0 0 elsif ($_ eq 'subtitle') { }
0 0 elsif ($_ eq '2page') { }
0 0 elsif ($_ eq 'desc') { }
0 0 elsif ($_ eq 'compact') { }
557 0 0 if $compact
558 0 0 if $spread
574 0 0 if ($default or $delta)
581 0 0 if ($delta)
586 0 0 if $default
594 0 0 if ($delta)
596 0 0 unless defined $cfg->{$_}
600 0 0 if defined $defcfg->{'pdf'}{'fonts'}{$f}{$_}
620 0 0 if ($delta)
649 0 0 if $o->{'error'}
656 0 0 if $o->{'error'}
659 0 0 if ($data =~ /^\s*#/mu) { }
677 0 0 if ($to and $to ne '-') { }
678 0 0 unless open my $fd, ">", $to
695 0 0 if (not defined $o) { }
0 0 elsif (is_hashref($o)) { }
0 0 elsif (is_arrayref($o)) { }
0 0 elsif ($o =~ /^\d+$/u) { }
699 0 0 unless $path eq ""
705 0 0 unless $path eq ""
745 3 1 if $locked
749 3 1 if $locked
760 0 0 unless exists $self->{$key} or $path =~ /^pdf\.(?:info|fonts|fontconfig)\./u or $path =~ /^pdf\.formats\.\w+-even\./u or $path =~ /^(meta|gridstrum\.symbols)\./u or $path =~ /^markup\.shortcodes\./u or $path =~ /^delegates\./u or $key =~ /^_/u
770 11 6 if (ref $hash->{$key} eq 'HASH') { }
2 4 elsif (ref $hash->{$key} eq 'ARRAY' and ref $self->{$key} eq 'ARRAY') { }
771 11 0 if (ref $self->{$key} eq 'HASH') { }
0 0 elsif (ref $self->{$key} eq 'ARRAY') { }
781 0 0 unless $ix =~ /^\d+$/u
796 2 0 if (@{$hash->{$key};}) { }
798 0 2 if ($v[0] eq 'append') { }
1 1 elsif ($v[0] eq 'prepend') { }
838 0 1 if $locked
852 3 3 if (_ref($self) eq "HASH" and _ref($orig) eq "HASH")
855 0 3 unless %$orig
861 0 0 unless exists $self->{$key} or $key =~ /^_/u or $path =~ m[^pdf/\.fonts\.]u
865 0 6 unless (exists $orig->{$key})
873 4 2 if (_ref($orig->{$key}) eq 'HASH' and _ref($self->{$key}) eq 'HASH' or _ref($orig->{$key}) eq 'ARRAY' and _ref($self->{$key}) eq 'ARRAY') { }
1 1 elsif (($self->{$key} // '') eq ($orig->{$key} // '')) { }
0 1 elsif (not defined $self->{$key} and _ref($orig->{$key}) eq 'ARRAY' and not @{$orig->{$key};} or not defined $orig->{$key} and _ref($self->{$key}) eq 'ARRAY' and not @{$self->{$key};}) { }
880 0 4 if $m eq "D" or $m eq "I"
881 4 0 if $m ne "I"
908 3 0 if (_ref($self) eq "ARRAY" and _ref($orig) eq "ARRAY")
911 1 2 if (&any(sub { _ref($_); } , @$self))
916 1 0 if $m ne "I"
922 1 1 if (my $dd = @$self - @$orig)
924 1 0 if ($dd > 0) { }
929 0 1 if $orig->[$ix] eq $self->[$ix]
933 0 1 unless ($t)
940 2 0 if $$orig[$ix - $dd] eq $self->[$ix]
944 1 0 unless ($t)
963 0 1 if $orig->[$ix] eq $self->[$ix]
968 1 0 if ($t)
978 0 0 if ($self eq $orig)
997 0 357 unless exists $res{$key} or $path eq "pdf.fontconfig." or $path =~ /^pdf\.(?:info|fonts)\./u or $path =~ /^pdf\.formats\.\w+-even\./u or $path =~ /^pdf\.formats\./u and $key =~ /\w+-even$/u or $path =~ /^(meta|gridstrum\.symbols)\./u or $path =~ /^delegates\./u or $path =~ /^parser\.preprocess\./u or $path =~ /^markup\.shortcodes\./u or $path =~ /^debug\./u or $key =~ /^_/u
1009 8507 28244 if (ref $right->{$key} eq 'HASH' and ref $res{$key} eq 'HASH') { }
3157 25087 elsif (ref $right->{$key} eq 'ARRAY' and ref $res{$key} eq 'ARRAY') { }
1024 1769 1388 if (@{$right->{$key};}) { }
1026 0 1769 if ($v[0] eq 'append') { }
0 1769 elsif ($v[0] eq 'prepend') { }
1065 0 40 unless defined $source
1077 0 132 if $verbose > 1
1082 50376 233546 if (is_hashref($o)) { }
19175 214371 elsif (is_arrayref($o)) { }
1083 50244 132 unless $path eq ""
1089 19175 0 unless $path eq ""
1108 6 6 $prp_context eq '' ? :
1112 5 29 if (/^\d+$/u) { }
1113 0 5 unless _ref($p) eq "ARRAY"
1117 0 29 unless _ref($p) eq "HASH"
1122 0 12 unless defined $p
1168 0 0 if ($compact)
1172 0 0 defined wantarray ? :