Branch Coverage

lib/ChordPro/Utils.pm
Criterion Covered Total %
branch 67 206 32.5


line true false branch
24 0 90 $^O =~ /\A(?:MSWin32|VMS|os2|dos|riscos)\z/u ? :
33 0 218 unless defined $dir
34 218 0 unless $dir =~ /^~/u
40 0 0 unless defined $first
50 0 0 if GLOB_ERROR()
52 0 0 if not defined $expanded or $expanded eq $first
64 0 0 if $main::options->{'trace'}
67 0 0 if $res
76 0 214 unless $prp
85 0 0 if $_->{'select'}
86 0 0 if ($_->{'pattern'}) { }
95 0 642 if ($code)
98 0 0 if $@
121 8 69 if (is_arrayref($line)) { }
130 30 39 if ($kdef and not $line =~ /^\w+=(?:['"]|[-+]?\d|\w)/u)
142 10 31 if (/^(.*?)=(["'])(.*)\2$/u) { }
25 6 elsif (/^(.*?)=(.+)$/u) { }
2 4 elsif (/^no[-_]?(.+)/u) { }
174 0 2 if (is_macos())
200 8 632 if not defined $arg or $arg eq ""
201 49 583 if $arg =~ /^(false|null|no|none|off|\s+|0)$/iu
209 0 9 unless defined $arg
230 2 9 unless /[\\\s]/u or $force
250 0 0 if ($label =~ /\?$/u)
254 0 0 if (defined $val) { }
255 0 0 if (&looks_like_number($val)) { }
265 0 0 if $suppressundef
268 0 0 defined wantarray ? :
277 133 0 if ($info->{'parser'} eq 'JSON::Relaxed') { }
282 133 0 unless $pp->is_error
283 0 0 if $source
292 0 0 if $info->{'relaxed'}
300 142 0 if ($relax > 1) { }
331 3 53 if (exists $specials->{$value}) { }
1 52 elsif (not ref $value || !($value =~ /[\[\{\]\}]/u)) { }
347 0 56 if (join(".", @keys) eq "pdf.fonts")
355 0 56 if ($keys[0] eq "chords")
364 19 55 if (is_arrayref($$cur)) { }
55 0 elsif (is_hashref($$cur)) { }
366 18 1 if (/^[<>]?[-+]?\d+$/u) { }
0 1 elsif (not exists $$cur->[0]{'name'}) { }
376 1 0 if ($$cur->[$i]{'name'} eq $_)
383 0 19 unless ($ok)
401 24 32 if (is_arrayref($$cur)) { }
30 2 elsif (is_hashref($$cur)) { }
402 9 15 if ($lastkey =~ />([-+]?\d+)?$/u) { }
6 9 elsif ($lastkey =~ /<([-+]?\d+)?$/u) { }
3 6 elsif ($lastkey =~ m[/([-+]?\d+)?$]u) { }
403 5 4 if (defined $1) { }
405 4 1 $1 >= 0 ? :
412 4 2 if (defined $1) { }
420 2 1 if (defined $1) { }
428 0 6 unless $lastkey =~ /^[-+]?\d+$/u
434 0 30 if ($errkey =~ /^chords\./u) { }
444 1 1 $lastkey =~ /^(?:[-+]?\d+|[<>])$/u ? :
472 0 46 if (defined $key and defined $value) { }
476 46 0 defined $key || @rest ? :
491 0 0 $n == 1 ? :
499 0 0 if ($size and $size =~ /^([.\d]+)(%|e[mx]|p[tx])$/u)
500 0 0 if $2 eq "%"
501 0 0 if $2 eq "em"
502 0 0 if $2 eq "ex"
503 0 0 if $2 eq "pt"
504 0 0 if $2 eq "px"
506 0 0 unless $size
513 0 0 unless defined $size
515 0 0 if ($ref = $sz{'fsize'} and $size =~ /^([.\d]+)(%|e[mx])$/u)
517 0 0 if $2 eq "%"
518 0 0 if $2 eq "em"
519 0 0 if $2 eq "ex"
521 0 0 if ($ref = $sz{'width'} and $size =~ /^([.\d]+)(%)$/u)
523 0 0 if $2 eq "%"
525 0 0 if ($size =~ /^([.\d]+)(p[tx]|[cm]m|in|)$/u)
526 0 0 if $2 eq "pt"
527 0 0 if $2 eq "px"
528 0 0 if $2 eq "cm"
529 0 0 if $2 eq "mm"
530 0 0 if $2 eq "in"
531 0 0 if $2 eq ""
576 0 62 unless (%args)
583 0 62 if exists $args{'callback'}
584 62 0 unless $callback
586 0 0 if (exists $args{'phase'})
587 0 0 if $phase ne $args{'phase'}
590 0 0 if (exists $args{'index'})
594 0 0 if $index < 0
596 0 0 if (exists $args{'total'})
603 0 0 if (is_coderef($callback)) { }
605 0 0 if ($@)
611 0 0 if ($callback eq "warn")
621 0 0 if $msg
646 0 0 unless defined $s
655 0 0 unless @s
658 0 0 if @s
669 0 0 ref $test ? :
670 0 0 if /^GIF\d\d[a-z]/u
671 0 0 if /^\xFF\xD8\xFF/u
672 0 0 if /^\x89PNG\x0D\x0A\x1A\x0A/u
673 0 0 if /^\s*P[1-6]/u
674 0 0 if /^II\x2A\x00/u
675 0 0 if /^MM\x00\x2A/u
676 0 0 if /^
686 0 0 if ($format)